]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
sm-notify: Use my_name when sending SM_NOTIFY requests
authorChuck Lever <chuck.lever@oracle.com>
Wed, 17 Mar 2010 10:15:08 +0000 (06:15 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 17 Mar 2010 10:15:08 +0000 (06:15 -0400)
The mon_name argument of an SM_NOTIFY request is a string that
identifies the rebooting host.

sm-notify should send the my_name provided by the local lockd at the
time the remote was monitored, rather than cocking up a mon_name
argument based on the present return value of gethostname(3).  If the
local system's hostname happened to change after the last reboot, then
the string returned by gethostname(3) will not be recognized by the
remote.  Thus the remote will never initiate lock recovery for the
original named host, possibly leaving stale locks.

The existing behavior of using the -v command line option as the
mon_name argument is preserved, but we now prevent sending an IP
presentation address, as some non-Linux implementations don't
recognize addresses as valid mon_names.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>

No differences found