All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] statd: not unlinking host files
Date: Sat, 06 Dec 2008 09:34:25 -0500	[thread overview]
Message-ID: <493A8D71.20603@RedHat.com> (raw)

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;

             reply	other threads:[~2008-12-06 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06 14:34 Steve Dickson [this message]
     [not found] ` <493A8D71.20603-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-12-08 23:33   ` [PATCH] statd: not unlinking host files 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493A8D71.20603@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.