From: "J. Bruce Fields" <bfields@fieldses.org>
To: Steve Dickson <SteveD@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] statd: not unlinking host files
Date: Mon, 8 Dec 2008 18:33:55 -0500 [thread overview]
Message-ID: <20081208233355.GB24083@fieldses.org> (raw)
In-Reply-To: <493A8D71.20603-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
On Sat, Dec 06, 2008 at 09:34:25AM -0500, Steve Dickson wrote:
> 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?
Bizarre--thanks for catching that.
But it looks like these are actually the only two callers to xunlink?
In which case, we should just ditch the "check" parameter entirely and
avoid some confusion....
(I wonder how it ever got this way in the first case?)
--b.
>
> 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;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-12-08 23:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20081208233355.GB24083@fieldses.org \
--to=bfields@fieldses.org \
--cc=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.