MDS: fix handle_client_rename use of path_traverse.

It was using the MDS_TRAVERSE_DISCOVERXLOCK flag, which allows
path_traverse to return success if it encounters a NULL dentry. When
we're looking for a source inode, though, that doesn't work out! We
want MDS_TRAVERSE_DISCOVER, which will go away and look for the dentry
on other inodes but requires a linked dentry, not a NULL one.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This commit is contained in:
Greg Farnum 2011-04-27 16:22:33 -07:00
parent 7d19f184c5
commit ac23196bc5

View File

@ -4605,7 +4605,7 @@ void Server::handle_client_rename(MDRequest *mdr)
CDir *destdir = destdn->get_dir();
assert(destdir->is_auth());
int r = mdcache->path_traverse(mdr, NULL, NULL, srcpath, &srctrace, NULL, MDS_TRAVERSE_DISCOVERXLOCK);
int r = mdcache->path_traverse(mdr, NULL, NULL, srcpath, &srctrace, NULL, MDS_TRAVERSE_DISCOVER);
if (r > 0)
return; // delayed
if (r < 0) {