Skip to content

Commit

Permalink
ovl: remove unnecessary lock check
Browse files Browse the repository at this point in the history
Directory is always locked until "out_unlock" label.  So lock check is not
needed.

Signed-off-by: youngjun <her0gyugyu@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
youngjun authored and Miklos Szeredi committed Jun 8, 2020
1 parent 74c6e38 commit 2068cf7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fs/overlayfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,8 @@ static struct dentry *ovl_workdir_create(struct ovl_fs *ofs,
struct dentry *work;
int err;
bool retried = false;
bool locked = false;

inode_lock_nested(dir, I_MUTEX_PARENT);
locked = true;

retry:
work = lookup_one_len(name, ofs->workbasedir, strlen(name));

Expand Down Expand Up @@ -741,9 +738,7 @@ static struct dentry *ovl_workdir_create(struct ovl_fs *ofs,
goto out_err;
}
out_unlock:
if (locked)
inode_unlock(dir);

inode_unlock(dir);
return work;

out_dput:
Expand Down

0 comments on commit 2068cf7

Please sign in to comment.