All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsdcltrack: skip "." and ".." when trying to clean out legacy recdir
Date: Wed, 28 Nov 2012 14:53:13 -0500	[thread overview]
Message-ID: <50B66BA9.7070107@RedHat.com> (raw)
In-Reply-To: <1352753698-17693-1-git-send-email-jlayton@redhat.com>



On 12/11/12 15:54, Jeff Layton wrote:
> readdir picks up these two entries as "normal" dentries, but rmdir'ing
> them won't work (and we wouldn't want to remove them anyway).
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Committed...

steved.
> ---
>  utils/nfsdcltrack/nfsdcltrack.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
> index 9801b9c..4334340 100644
> --- a/utils/nfsdcltrack/nfsdcltrack.c
> +++ b/utils/nfsdcltrack/nfsdcltrack.c
> @@ -379,6 +379,17 @@ cltrack_legacy_gracedone(void)
>  	while ((entry = readdir(v4recovery))) {
>  		int len;
>  
> +		/* skip "." and ".." */
> +		if (entry->d_name[0] == '.') {
> +			switch (entry->d_name[1]) {
> +			case '\0':
> +				continue;
> +			case '.':
> +				if (entry->d_name[2] == '\0')
> +					continue;
> +			}
> +		}
> +
>  		/* borrow the clientid blob for this */
>  		len = snprintf((char *)blob, sizeof(blob), "%s/%s", dirname,
>  				entry->d_name);
> 

      reply	other threads:[~2012-11-28 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 20:54 [PATCH] nfsdcltrack: skip "." and ".." when trying to clean out legacy recdir Jeff Layton
2012-11-28 19:53 ` Steve Dickson [this message]

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=50B66BA9.7070107@RedHat.com \
    --to=steved@redhat.com \
    --cc=jlayton@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.