* [PATCH] nfsdcltrack: skip "." and ".." when trying to clean out legacy recdir
@ 2012-11-12 20:54 Jeff Layton
2012-11-28 19:53 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2012-11-12 20:54 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
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>
---
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);
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfsdcltrack: skip "." and ".." when trying to clean out legacy recdir
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
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2012-11-28 19:53 UTC (permalink / raw)
To: Jeff Layton; +Cc: linux-nfs
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);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-28 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).