[Linux-cluster] [RFC] Read access to /config/dlm/<cluster>/comms/<comm>/addr
Masatake YAMATO
yamato at redhat.com
Thu Jun 9 08:55:29 UTC 2011
Hi,
I've found /config/dlm/<cluster>/comms/<comm>/addr is readable
(in meaning of ls -l) but no handler(comm_addr_read) is defined in
dlm/fs/dlm/config.c.
If cat command works fine with /config/dlm/<cluster>/comms/<comm>/addr,
it will be nice to understand the status of dlm. So I'm thinking about
writing a patch.
But after reading the source code, I've found its difficulties;
/config/dlm/<cluster>/comms/<comm>/addr holds 'struct
sockaddr_storage'.
I'd like to get your comment before going ahead.
I think we have three choice. Which do you think the best?
1. When 'cat /config/dlm/<cluster>/comms/<comm>/addr' is invoked,
it converts the held sockaddr_storage to human readable text and
provids it to userland.
e.g.
# cat /config/dlm/<cluster>/comms/<comm>/addr
AF_INET
192.168.151.1
#
Advantage: human readable
Disadvantage: data asymmetry in writing and reading
When writing to
/config/dlm/<cluster>/comms/<comm>/addr, it expects
binary format of sockaddr_storage.
2. When 'cat /config/dlm/<cluster>/comms/<comm>/addr' is invoked,
it provides the held sockaddr_storage to userland.
Advantage: data symmetry in writing and reading.
Disadvantage: not human readable. It needs something effort to
understanding the returned binary data.
3. Make /config/dlm/<cluster>/comms/<comm>/addr unreadable (in meaning of ls -l)
e.g.
# ls -l /config/dlm/<cluster>/comms/<comm>/addr
--w-------. 1 root root 4096 Jun 9 08:51 /config/dlm/<cluster>/comms/<comm>/addr
Advantage: easy to implement.
Disadvantage: no way to know the value of node addr of dlm view.
Regards,
Masatake YAMATO
More information about the Linux-cluster
mailing list