diff options
author | Bernd Schubert <bschubert@ddn.com> | 2023-10-23 20:47:18 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-10-24 10:51:05 +0200 |
commit | c04d905f6c7c41f137de7e4a9279e5c938eb19ef (patch) | |
tree | 08af064c0b2224d1f06903ea35bf1712223c48d4 /fs/namei.c | |
parent | writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs (diff) | |
download | linux-c04d905f6c7c41f137de7e4a9279e5c938eb19ef.tar.xz linux-c04d905f6c7c41f137de7e4a9279e5c938eb19ef.zip |
vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups
The calling code actually handles -ECHILD, so this BUG_ON
can be converted to WARN_ON_ONCE.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Link: https://lore.kernel.org/r/20231023184718.11143-1-bschubert@ddn.com
Cc: Christian Brauner <brauner@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Dharmendra Singh <dsingh@ddn.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 127c868a8992..8571855c281d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3516,7 +3516,8 @@ static const char *open_last_lookups(struct nameidata *nd, if (likely(dentry)) goto finish_lookup; - BUG_ON(nd->flags & LOOKUP_RCU); + if (WARN_ON_ONCE(nd->flags & LOOKUP_RCU)) + return ERR_PTR(-ECHILD); } else { /* create side of things */ if (nd->flags & LOOKUP_RCU) { |