]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
namei: Remove extraneous rmdir
authorAndrew Deason <adeason@sinenomine.net>
Thu, 10 Nov 2011 17:58:12 +0000 (11:58 -0600)
committerDerrick Brashear <shadow@dementix.org>
Sat, 19 Nov 2011 16:11:38 +0000 (08:11 -0800)
We just unlinked the file, so we know we won't be able to rmdir() the
same thing. Give a path one level higher to
namei_RemoveDataDirectories, so we start rmdir()ing at the parent dir.

Reviewed-on: http://gerrit.openafs.org/5833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit b41e30a55c8aeb6d7f42d74f9eb090232032057f)

Change-Id: Ibd14490e2d85bd78522472203ad57120237bff22
Reviewed-on: http://gerrit.openafs.org/6079
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/vol/namei_ops.c

index 9a1076a3fcc3d4525b985acee7ddf4b5bf5c7b0e..6b884f05d6f3e23f401821ab76ce4980d7345a5b 100644 (file)
@@ -1063,6 +1063,11 @@ namei_dec(IHandle_t * ih, Inode ino, int p1)
                /* Try to remove directory. If it fails, that's ok.
                 * Salvage will clean up.
                 */
+               char *slash = strrchr(name.n_path, OS_DIRSEPC);
+               if (slash) {
+                   /* avoid an rmdir() on the file we just unlinked */
+                   *slash = '\0';
+               }
                (void)namei_RemoveDataDirectories(&name);
            }
        }