summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-11-28 14:03:55 -0500
committerSteve Dickson <steved@redhat.com>2012-11-28 14:48:01 -0500
commitbf64ebb2faaba0666068c502353fb0c49c23c756 (patch)
tree99b865116681fe1382d4656111011d70bff49c01
parent5dfc6e239102e3a957c102f0ad194992361b3dc4 (diff)
downloadnfs-utils-bf64ebb2faaba0666068c502353fb0c49c23c756.zip
nfs-utils-bf64ebb2faaba0666068c502353fb0c49c23c756.tar.gz
nfs-utils-bf64ebb2faaba0666068c502353fb0c49c23c756.tar.xz
nfsdcltrack: skip "." and ".." when trying to clean out legacy recdir
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> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/nfsdcltrack/nfsdcltrack.c11
1 files changed, 11 insertions, 0 deletions
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);