From: youngjun <her0gyugyu@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org,
youngjun <her0gyugyu@gmail.com>
Subject: [PATCH] overlay: remove not necessary lock check.
Date: Sun, 7 Jun 2020 02:04:06 -0700 [thread overview]
Message-ID: <20200607090406.129012-1-her0gyugyu@gmail.com> (raw)
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
next reply other threads:[~2020-06-07 9:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-07 9:04 youngjun [this message]
2020-06-08 7:57 ` [PATCH] overlay: remove not necessary lock check Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200607090406.129012-1-her0gyugyu@gmail.com \
--to=her0gyugyu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox