Skip to content

Commit 2068cf7

Browse files
youngjun-89Miklos Szeredi
authored andcommitted
ovl: remove unnecessary lock check
Directory is always locked until "out_unlock" label. So lock check is not needed. Signed-off-by: youngjun <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 74c6e38 commit 2068cf7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fs/overlayfs/super.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,8 @@ static struct dentry *ovl_workdir_create(struct ovl_fs *ofs,
676676
struct dentry *work;
677677
int err;
678678
bool retried = false;
679-
bool locked = false;
680679

681680
inode_lock_nested(dir, I_MUTEX_PARENT);
682-
locked = true;
683-
684681
retry:
685682
work = lookup_one_len(name, ofs->workbasedir, strlen(name));
686683

@@ -741,9 +738,7 @@ static struct dentry *ovl_workdir_create(struct ovl_fs *ofs,
741738
goto out_err;
742739
}
743740
out_unlock:
744-
if (locked)
745-
inode_unlock(dir);
746-
741+
inode_unlock(dir);
747742
return work;
748743

749744
out_dput:

0 commit comments

Comments
 (0)