client: avoid taking inode ref in case of nonexistent dir

Signed-off-by: Andrey Stepachev <octo@yandex-team.ru>
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Andrey Stepachev 2012-01-12 19:26:34 +04:00 committed by Sage Weil
parent cedd92bea6
commit 1e56367e5e

View File

@ -4140,9 +4140,9 @@ int Client::opendir(const char *relpath, dir_result_t **dirpp)
int Client::_opendir(Inode *in, dir_result_t **dirpp, int uid, int gid)
{
*dirpp = new dir_result_t(in);
if (!in->is_dir())
return -ENOTDIR;
*dirpp = new dir_result_t(in);
(*dirpp)->set_frag(in->dirfragtree[0]);
if (in->dir)
(*dirpp)->release_count = in->dir->release_count;