Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] statd: not unlinking host files
@ 2008-12-06 14:34 Steve Dickson
       [not found] ` <493A8D71.20603-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2008-12-06 14:34 UTC (permalink / raw)
  To: Linux NFS Mailing list

Again working with the state file code, I notice that statd was
not unlinking hosts files when the kernel sent up the 
sm_unmon messages. This following patch address the reason why... 

Comments?

steved.

commit f8536d0e210a8151900f8c68185927790239eb62
Author: Steve Dickson <steved@redhat.com>
Date:   Sat Dec 6 09:30:43 2008 -0500

    statd: not unlinking host files
    
    Statd is not unlinking host files during SM_UNMON and
    SM_UNMON_ALL calls because the given host is still on the run-time
    notify list (rtnl) and the check flag is set when xunlink() is
    called. But the next thing the caller of xunlink() does is
    remove the host from the rtnl list which means the
    unlink will never happen.
    
    So in cases where xunlink() is immediately follow by a call
    to nlist_free() (which removes the host from the list) the
    check flag to xunlink() is not set.
    
    Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c
index a6a1d9c..7d6e4da 100644
--- a/utils/statd/monitor.c
+++ b/utils/statd/monitor.c
@@ -352,7 +352,7 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp)
 			/* PRC: do the HA callout: */
 			ha_callout("del-client", mon_name, my_name, -1);
 
-			xunlink(SM_DIR, clnt->dns_name, 1);
+			xunlink(SM_DIR, clnt->dns_name, 0);
 			nlist_free(&rtnl, clnt);
 
 			return (&result);
@@ -404,7 +404,7 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp)
 			temp = NL_NEXT(clnt);
 			/* PRC: do the HA callout: */
 			ha_callout("del-client", mon_name, my_name, -1);
-			xunlink(SM_DIR, clnt->dns_name, 1);
+			xunlink(SM_DIR, clnt->dns_name, 0);
 			nlist_free(&rtnl, clnt);
 			++count;
 			clnt = temp;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-17 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-06 14:34 [PATCH] statd: not unlinking host files Steve Dickson
     [not found] ` <493A8D71.20603-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-12-08 23:33   ` J. Bruce Fields
2008-12-08 23:48     ` Chuck Lever
2008-12-09  0:40       ` Steve Dickson
2008-12-09  0:40     ` Steve Dickson
2008-12-17 21:48   ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox