namei: Remove extraneous rmdir

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.

Change-Id: Ifa54d1cc07ed2d277416d09eabc45aa1e1c3803a
Reviewed-on: http://gerrit.openafs.org/5833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Andrew Deason 2011-11-10 11:58:12 -06:00 committed by Derrick Brashear
parent 4c679e380f
commit b41e30a55c

View File

@ -1006,6 +1006,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);
}
}