mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
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:
parent
cedd92bea6
commit
1e56367e5e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user