diff mbox series

[linux-next] fs: Fix lookup_flags in vfs_statx()

Message ID 20220224191727.55b300c4@gandalf.local.home (mailing list archive)
State New, archived
Headers show
Series [linux-next] fs: Fix lookup_flags in vfs_statx() | expand

Commit Message

Steven Rostedt Feb. 25, 2022, 12:17 a.m. UTC
From: Steven Rostedt (Google) <rostedt@goodmis.org>

I needed to test Linux next and it locked up at starting init.

I bisected it down to:

30512d54fae35 ("fs: replace const char* parameter in vfs_statx and do_statx with struct filename")
1e0561928e3ab ("io-uring: Copy path name during prepare stage for statx")

The first commit did not even compile, so I consider the two of the them
the same commit.

Looking at what was changed, I see that the lookup_flags were removed from
the filename_lookup() in the vfs_statx() function, and that the
lookup_flags that were used later on in the function, were never properly
updated either.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
AT_EMPTY_PATH | @@ -225,7 +225,7 @@ static int vfs_statx(int dfd, struct
filename *filename, int flags, return -EINVAL;
 
 retry:
-	error = filename_lookup(dfd, filename, flags, &path, NULL);
+	error = filename_lookup(dfd, filename, lookup_flags, &path, NULL);
 	if (error)
 		goto out;

Comments

Steven Rostedt Feb. 25, 2022, 12:27 a.m. UTC | #1
[ Adding Stephen. This was on next-20220223 ]

On Thu, 24 Feb 2022 19:17:27 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> I needed to test Linux next and it locked up at starting init.
> 
> I bisected it down to:
> 
> 30512d54fae35 ("fs: replace const char* parameter in vfs_statx and do_statx with struct filename")
> 1e0561928e3ab ("io-uring: Copy path name during prepare stage for statx")
> 
> The first commit did not even compile, so I consider the two of the them
> the same commit.
> 
> Looking at what was changed, I see that the lookup_flags were removed from
> the filename_lookup() in the vfs_statx() function, and that the
> lookup_flags that were used later on in the function, were never properly
> updated either.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> diff --git a/fs/stat.c b/fs/stat.c
> index f0a9702cee67..2a2132670929 100644
> --- a/fs/stat.c
> +++ b/fs/stat.c
> @@ -217,7 +217,7 @@ static int vfs_statx(int dfd, struct filename
> *filename, int flags, struct kstat *stat, u32 request_mask)
>  {
>  	struct path path;
> -	unsigned lookup_flags = 0;
> +	unsigned lookup_flags = getname_statx_lookup_flags(flags);
>  	int error;
>  
>  	if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |
> AT_EMPTY_PATH | @@ -225,7 +225,7 @@ static int vfs_statx(int dfd, struct
> filename *filename, int flags, return -EINVAL;
>  
>  retry:
> -	error = filename_lookup(dfd, filename, flags, &path, NULL);
> +	error = filename_lookup(dfd, filename, lookup_flags, &path, NULL);
>  	if (error)
>  		goto out;
>
Stefan Roesch Feb. 25, 2022, 1:37 a.m. UTC | #2
On 2/24/22 4:17 PM, Steven Rostedt wrote:
> From: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> I needed to test Linux next and it locked up at starting init.
> 
> I bisected it down to:
> 
> 30512d54fae35 ("fs: replace const char* parameter in vfs_statx and do_statx with struct filename")
> 1e0561928e3ab ("io-uring: Copy path name during prepare stage for statx")
> 
> The first commit did not even compile, so I consider the two of the them
> the same commit.
> 
> Looking at what was changed, I see that the lookup_flags were removed from
> the filename_lookup() in the vfs_statx() function, and that the
> lookup_flags that were used later on in the function, were never properly
> updated either.
> 

Steven, thanks for the fix.

> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> diff --git a/fs/stat.c b/fs/stat.c
> index f0a9702cee67..2a2132670929 100644
> --- a/fs/stat.c
> +++ b/fs/stat.c
> @@ -217,7 +217,7 @@ static int vfs_statx(int dfd, struct filename
> *filename, int flags, struct kstat *stat, u32 request_mask)
>  {
>  	struct path path;
> -	unsigned lookup_flags = 0;
> +	unsigned lookup_flags = getname_statx_lookup_flags(flags);
>  	int error;
>  
>  	if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |
> AT_EMPTY_PATH | @@ -225,7 +225,7 @@ static int vfs_statx(int dfd, struct
> filename *filename, int flags, return -EINVAL;
>  
>  retry:
> -	error = filename_lookup(dfd, filename, flags, &path, NULL);
> +	error = filename_lookup(dfd, filename, lookup_flags, &path, NULL);
>  	if (error)
>  		goto out;
>
diff mbox series

Patch

diff --git a/fs/stat.c b/fs/stat.c
index f0a9702cee67..2a2132670929 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -217,7 +217,7 @@  static int vfs_statx(int dfd, struct filename
*filename, int flags, struct kstat *stat, u32 request_mask)
 {
 	struct path path;
-	unsigned lookup_flags = 0;
+	unsigned lookup_flags = getname_statx_lookup_flags(flags);
 	int error;
 
 	if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |