linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] walk_component(): get inode in lookup_slow branch statement block
@ 2022-06-22  8:51 sunliming
  2022-06-22 10:34 ` Al Viro
  0 siblings, 1 reply; 7+ messages in thread
From: sunliming @ 2022-06-22  8:51 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, sunliming, kelulanainsley, sunliming

The inode variable is used as a parameter by the step_into function,
but is not assigned a value in the sub-lookup_slow branch path. So
get the inode in the sub-lookup_slow branch path.

Signed-off-by: sunliming <sunliming@kylinos.cn>
---
 fs/namei.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/namei.c b/fs/namei.c
index 1f28d3f463c3..a1a3e9514f46 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2014,6 +2014,8 @@ static const char *walk_component(struct nameidata *nd, int flags)
 		dentry = lookup_slow(&nd->last, nd->path.dentry, nd->flags);
 		if (IS_ERR(dentry))
 			return ERR_CAST(dentry);
+
+		inode = d_backing_inode(dentry);
 	}
 	if (!(flags & WALK_MORE) && nd->depth)
 		put_link(nd);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] walk_component(): get inode in lookup_slow branch statement block
@ 2022-06-22  8:53 sunliming
  0 siblings, 0 replies; 7+ messages in thread
From: sunliming @ 2022-06-22  8:53 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, sunliming, kelulanainsley

The inode variable is used as a parameter by the step_into function,
but is not assigned a value in the sub-lookup_slow branch path. So
get the inode in the sub-lookup_slow branch path.

Signed-off-by: sunliming <sunliming@kylinos.cn>
---
 fs/namei.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/namei.c b/fs/namei.c
index 1f28d3f463c3..a1a3e9514f46 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2014,6 +2014,8 @@ static const char *walk_component(struct nameidata *nd, int flags)
 		dentry = lookup_slow(&nd->last, nd->path.dentry, nd->flags);
 		if (IS_ERR(dentry))
 			return ERR_CAST(dentry);
+
+		inode = d_backing_inode(dentry);
 	}
 	if (!(flags & WALK_MORE) && nd->depth)
 		put_link(nd);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-23  9:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  8:51 [PATCH] walk_component(): get inode in lookup_slow branch statement block sunliming
2022-06-22 10:34 ` Al Viro
2022-06-23  3:26   ` sunliming
2022-06-23  3:44   ` sunliming
2022-06-23  3:48     ` Al Viro
2022-06-23  9:57       ` sunliming
2022-06-22  8:53 sunliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).