diff options
author | youngjun <her0gyugyu@gmail.com> | 2020-06-07 02:04:06 -0700 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-06-08 09:57:19 +0200 |
commit | 2068cf7dfbc69c4097c95af3a0bd943ced155a76 (patch) | |
tree | 5e117e03f9a0ba3183498170a439f4a04e9844c6 /fs/overlayfs | |
parent | 74c6e384e991c5305754e3c79edf768a62b00563 (diff) |
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/overlayfs')
-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: |