]> git.decadent.org.uk Git - nfs-utils.git/commit
libnsm.a: sm-notify sometimes ignores monitored hosts nfs-utils-1-2-4-rc4
authorChuck Lever <chuck.lever@oracle.com>
Mon, 13 Dec 2010 19:50:45 +0000 (14:50 -0500)
committerSteve Dickson <steved@redhat.com>
Mon, 13 Dec 2010 19:56:11 +0000 (14:56 -0500)
commit5c498280fd9353ded3ea169841079bdae23418e2
tree75d025f2acc3b86fc157a3deba4ec86de0dab705
parent089df7c754d9ebab0a7b804f396626ac95fee2e6
libnsm.a: sm-notify sometimes ignores monitored hosts

Monitored host information is stored in files under /var/lib/nfs.
When visiting entries in the monitored hosts directory, libnsm.a
examines the value of dirent.d_type to determine if an entry is a
regular file.

According to readdir(3), the d_type field is not supported by all
file system types.  My root file system happens to be one where d_type
isn't supported.  Typical installations that use an ext-derived root
file system are not exposed to this issue, but those who use xfs, for
instance, are.

On such file systems, not only are remote peers not notified of
reboots, but the NSM state number is never incremented.  A statd warm
restart would not re-monitor any hosts that were monitored before
the restart.

When writing support/nsm/file.c, I copied the use of d_type from the
original statd code, so this has likely been an issue for some time.

Replace the use of d_type in support/nsm/file.c with a call to
lstat(2).  It's extra code, but is guaranteed to work on all file
system types.

Note there is a usage of d_type in gssd.  I'll let gssd and rpcpipefs
experts decide whether that's worth changing.

Fix for:

  https://bugzilla.linux-nfs.org/show_bug.cgi?id=193

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nsm/file.c