diff options
author | youngjun <her0gyugyu@gmail.com> | 2020-06-07 11:04:06 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-06-08 09:57:19 +0200 |
commit | 2068cf7dfbc69c4097c95af3a0bd943ced155a76 (patch) | |
tree | 5e117e03f9a0ba3183498170a439f4a04e9844c6 /fs | |
parent | ovl: make oip->index bool (diff) | |
download | linux-2068cf7dfbc69c4097c95af3a0bd943ced155a76.tar.xz linux-2068cf7dfbc69c4097c95af3a0bd943ced155a76.zip |
ovl: remove unnecessary lock check
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/overlayfs/super.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 8d8cd46e1482..91476bc422f9 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -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)); @@ -741,9 +738,7 @@ retry: goto out_err; } out_unlock: - if (locked) - inode_unlock(dir); - + inode_unlock(dir); return work; out_dput: |