* [PATCH] overlay: remove not necessary lock check.
@ 2020-06-07 9:04 youngjun
2020-06-08 7:57 ` Miklos Szeredi
0 siblings, 1 reply; 2+ messages in thread
From: youngjun @ 2020-06-07 9:04 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs, linux-kernel, youngjun
dir is always locked until "out_unlock" label.
So lock check is not needed.
Signed-off-by: youngjun <her0gyugyu@gmail.com>
---
fs/overlayfs/super.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 732ad5495c92..43257c18fe26 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -615,10 +615,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));
@@ -680,9 +678,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:
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] overlay: remove not necessary lock check.
2020-06-07 9:04 [PATCH] overlay: remove not necessary lock check youngjun
@ 2020-06-08 7:57 ` Miklos Szeredi
0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2020-06-08 7:57 UTC (permalink / raw)
To: youngjun; +Cc: overlayfs, linux-kernel
On Sun, Jun 7, 2020 at 11:04 AM youngjun <her0gyugyu@gmail.com> wrote:
>
> dir is always locked until "out_unlock" label.
> So lock check is not needed.
Thanks, applied.
Miklos
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-08 7:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07 9:04 [PATCH] overlay: remove not necessary lock check youngjun
2020-06-08 7:57 ` Miklos Szeredi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.