linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl
       [not found] <https://lore.kernel.org/linux-xfs/20210203171633.GX7193@magnolia>
@ 2021-02-03 17:30 ` Christian Brauner
  2021-02-03 17:38   ` Darrick J. Wong
  2021-02-04  0:55   ` Shaokun Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Christian Brauner @ 2021-02-03 17:30 UTC (permalink / raw)
  To: Darrick J. Wong, Christoph Hellwig
  Cc: Shaokun Zhang, linux-xfs, Christian Brauner

From: Christoph Hellwig <hch@lst.de>

The mp variable in xfs_file_compat_ioctl is only used when
BROKEN_X86_ALIGNMENT is define.  Remove it and just open code the
dereference in a few places.

Fixes: f736d93d76d3 ("xfs: support idmapped mounts")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
---
As mentioned in the thread, I'd take this on top of Christoph's patch if
people are ok with this:
https://git.kernel.org/brauner/h/idmapped_mounts
---
 fs/xfs/xfs_ioctl32.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
index 926427b19573..33c09ec8e6c0 100644
--- a/fs/xfs/xfs_ioctl32.c
+++ b/fs/xfs/xfs_ioctl32.c
@@ -438,7 +438,6 @@ xfs_file_compat_ioctl(
 {
 	struct inode		*inode = file_inode(filp);
 	struct xfs_inode	*ip = XFS_I(inode);
-	struct xfs_mount	*mp = ip->i_mount;
 	void			__user *arg = compat_ptr(p);
 	int			error;
 
@@ -458,7 +457,7 @@ xfs_file_compat_ioctl(
 		return xfs_ioc_space(filp, &bf);
 	}
 	case XFS_IOC_FSGEOMETRY_V1_32:
-		return xfs_compat_ioc_fsgeometry_v1(mp, arg);
+		return xfs_compat_ioc_fsgeometry_v1(ip->i_mount, arg);
 	case XFS_IOC_FSGROWFSDATA_32: {
 		struct xfs_growfs_data	in;
 
@@ -467,7 +466,7 @@ xfs_file_compat_ioctl(
 		error = mnt_want_write_file(filp);
 		if (error)
 			return error;
-		error = xfs_growfs_data(mp, &in);
+		error = xfs_growfs_data(ip->i_mount, &in);
 		mnt_drop_write_file(filp);
 		return error;
 	}
@@ -479,7 +478,7 @@ xfs_file_compat_ioctl(
 		error = mnt_want_write_file(filp);
 		if (error)
 			return error;
-		error = xfs_growfs_rt(mp, &in);
+		error = xfs_growfs_rt(ip->i_mount, &in);
 		mnt_drop_write_file(filp);
 		return error;
 	}

base-commit: f736d93d76d3e97d6986c6d26c8eaa32536ccc5c
-- 
2.30.0


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

* Re: [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl
  2021-02-03 17:30 ` [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl Christian Brauner
@ 2021-02-03 17:38   ` Darrick J. Wong
  2021-02-03 17:42     ` Christian Brauner
  2021-02-04  0:55   ` Shaokun Zhang
  1 sibling, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2021-02-03 17:38 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Christoph Hellwig, Shaokun Zhang, linux-xfs

On Wed, Feb 03, 2021 at 06:30:10PM +0100, Christian Brauner wrote:
> From: Christoph Hellwig <hch@lst.de>
> 
> The mp variable in xfs_file_compat_ioctl is only used when
> BROKEN_X86_ALIGNMENT is define.  Remove it and just open code the
> dereference in a few places.
> 
> Fixes: f736d93d76d3 ("xfs: support idmapped mounts")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
> As mentioned in the thread, I'd take this on top of Christoph's patch if
> people are ok with this:
> https://git.kernel.org/brauner/h/idmapped_mounts

I don't mind taking this via the xfs tree, unless merging through the
idmapped mounts series is easier/causes less rebase mess?

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_ioctl32.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
> index 926427b19573..33c09ec8e6c0 100644
> --- a/fs/xfs/xfs_ioctl32.c
> +++ b/fs/xfs/xfs_ioctl32.c
> @@ -438,7 +438,6 @@ xfs_file_compat_ioctl(
>  {
>  	struct inode		*inode = file_inode(filp);
>  	struct xfs_inode	*ip = XFS_I(inode);
> -	struct xfs_mount	*mp = ip->i_mount;
>  	void			__user *arg = compat_ptr(p);
>  	int			error;
>  
> @@ -458,7 +457,7 @@ xfs_file_compat_ioctl(
>  		return xfs_ioc_space(filp, &bf);
>  	}
>  	case XFS_IOC_FSGEOMETRY_V1_32:
> -		return xfs_compat_ioc_fsgeometry_v1(mp, arg);
> +		return xfs_compat_ioc_fsgeometry_v1(ip->i_mount, arg);
>  	case XFS_IOC_FSGROWFSDATA_32: {
>  		struct xfs_growfs_data	in;
>  
> @@ -467,7 +466,7 @@ xfs_file_compat_ioctl(
>  		error = mnt_want_write_file(filp);
>  		if (error)
>  			return error;
> -		error = xfs_growfs_data(mp, &in);
> +		error = xfs_growfs_data(ip->i_mount, &in);
>  		mnt_drop_write_file(filp);
>  		return error;
>  	}
> @@ -479,7 +478,7 @@ xfs_file_compat_ioctl(
>  		error = mnt_want_write_file(filp);
>  		if (error)
>  			return error;
> -		error = xfs_growfs_rt(mp, &in);
> +		error = xfs_growfs_rt(ip->i_mount, &in);
>  		mnt_drop_write_file(filp);
>  		return error;
>  	}
> 
> base-commit: f736d93d76d3e97d6986c6d26c8eaa32536ccc5c
> -- 
> 2.30.0
> 

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

* Re: [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl
  2021-02-03 17:38   ` Darrick J. Wong
@ 2021-02-03 17:42     ` Christian Brauner
  2021-02-03 18:17       ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2021-02-03 17:42 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, Shaokun Zhang, linux-xfs

On Wed, Feb 03, 2021 at 09:38:35AM -0800, Darrick J. Wong wrote:
> On Wed, Feb 03, 2021 at 06:30:10PM +0100, Christian Brauner wrote:
> > From: Christoph Hellwig <hch@lst.de>
> > 
> > The mp variable in xfs_file_compat_ioctl is only used when
> > BROKEN_X86_ALIGNMENT is define.  Remove it and just open code the
> > dereference in a few places.
> > 
> > Fixes: f736d93d76d3 ("xfs: support idmapped mounts")
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> > ---
> > As mentioned in the thread, I'd take this on top of Christoph's patch if
> > people are ok with this:
> > https://git.kernel.org/brauner/h/idmapped_mounts
> 
> I don't mind taking this via the xfs tree, unless merging through the
> idmapped mounts series is easier/causes less rebase mess?

It's caused by Christoph's xfs conversion patch as he's changing the one
place where "mp" was passed outside the BROKEN_X86_ALIGNMENT ifdef to a
struct file as arg. So I'd just apply it on top of that if you don't
mind. Would make it easier for Stephen Rothwell too as he's dealing with
all the merge conflicts. :)

> 
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Tyvm!
Christian

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

* Re: [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl
  2021-02-03 17:42     ` Christian Brauner
@ 2021-02-03 18:17       ` Darrick J. Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2021-02-03 18:17 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Christoph Hellwig, Shaokun Zhang, linux-xfs

On Wed, Feb 03, 2021 at 06:42:15PM +0100, Christian Brauner wrote:
> On Wed, Feb 03, 2021 at 09:38:35AM -0800, Darrick J. Wong wrote:
> > On Wed, Feb 03, 2021 at 06:30:10PM +0100, Christian Brauner wrote:
> > > From: Christoph Hellwig <hch@lst.de>
> > > 
> > > The mp variable in xfs_file_compat_ioctl is only used when
> > > BROKEN_X86_ALIGNMENT is define.  Remove it and just open code the
> > > dereference in a few places.
> > > 
> > > Fixes: f736d93d76d3 ("xfs: support idmapped mounts")
> > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > > Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> > > ---
> > > As mentioned in the thread, I'd take this on top of Christoph's patch if
> > > people are ok with this:
> > > https://git.kernel.org/brauner/h/idmapped_mounts
> > 
> > I don't mind taking this via the xfs tree, unless merging through the
> > idmapped mounts series is easier/causes less rebase mess?
> 
> It's caused by Christoph's xfs conversion patch as he's changing the one
> place where "mp" was passed outside the BROKEN_X86_ALIGNMENT ifdef to a
> struct file as arg. So I'd just apply it on top of that if you don't
> mind. Would make it easier for Stephen Rothwell too as he's dealing with
> all the merge conflicts. :)

Works for me; I'm 100% ok with it going through your tree. :)

--D

> 
> > 
> > Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> 
> Tyvm!
> Christian

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

* Re: [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl
  2021-02-03 17:30 ` [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl Christian Brauner
  2021-02-03 17:38   ` Darrick J. Wong
@ 2021-02-04  0:55   ` Shaokun Zhang
  1 sibling, 0 replies; 5+ messages in thread
From: Shaokun Zhang @ 2021-02-04  0:55 UTC (permalink / raw)
  To: Christian Brauner, Darrick J. Wong, Christoph Hellwig; +Cc: linux-xfs

It works on arm64 platform, so,

Tested-by: Shaokun Zhang <zhangshaokun@hisilicon.com>

Thanks,
Shaokun

在 2021/2/4 1:30, Christian Brauner 写道:
> From: Christoph Hellwig <hch@lst.de>
> 
> The mp variable in xfs_file_compat_ioctl is only used when
> BROKEN_X86_ALIGNMENT is define.  Remove it and just open code the
> dereference in a few places.
> 
> Fixes: f736d93d76d3 ("xfs: support idmapped mounts")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
> As mentioned in the thread, I'd take this on top of Christoph's patch if
> people are ok with this:
> https://git.kernel.org/brauner/h/idmapped_mounts
> ---
>  fs/xfs/xfs_ioctl32.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
> index 926427b19573..33c09ec8e6c0 100644
> --- a/fs/xfs/xfs_ioctl32.c
> +++ b/fs/xfs/xfs_ioctl32.c
> @@ -438,7 +438,6 @@ xfs_file_compat_ioctl(
>  {
>  	struct inode		*inode = file_inode(filp);
>  	struct xfs_inode	*ip = XFS_I(inode);
> -	struct xfs_mount	*mp = ip->i_mount;
>  	void			__user *arg = compat_ptr(p);
>  	int			error;
>  
> @@ -458,7 +457,7 @@ xfs_file_compat_ioctl(
>  		return xfs_ioc_space(filp, &bf);
>  	}
>  	case XFS_IOC_FSGEOMETRY_V1_32:
> -		return xfs_compat_ioc_fsgeometry_v1(mp, arg);
> +		return xfs_compat_ioc_fsgeometry_v1(ip->i_mount, arg);
>  	case XFS_IOC_FSGROWFSDATA_32: {
>  		struct xfs_growfs_data	in;
>  
> @@ -467,7 +466,7 @@ xfs_file_compat_ioctl(
>  		error = mnt_want_write_file(filp);
>  		if (error)
>  			return error;
> -		error = xfs_growfs_data(mp, &in);
> +		error = xfs_growfs_data(ip->i_mount, &in);
>  		mnt_drop_write_file(filp);
>  		return error;
>  	}
> @@ -479,7 +478,7 @@ xfs_file_compat_ioctl(
>  		error = mnt_want_write_file(filp);
>  		if (error)
>  			return error;
> -		error = xfs_growfs_rt(mp, &in);
> +		error = xfs_growfs_rt(ip->i_mount, &in);
>  		mnt_drop_write_file(filp);
>  		return error;
>  	}
> 
> base-commit: f736d93d76d3e97d6986c6d26c8eaa32536ccc5c
> 

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

end of thread, other threads:[~2021-02-04  0:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <https://lore.kernel.org/linux-xfs/20210203171633.GX7193@magnolia>
2021-02-03 17:30 ` [PATCH -next] xfs: remove the possibly unused mp variable in xfs_file_compat_ioctl Christian Brauner
2021-02-03 17:38   ` Darrick J. Wong
2021-02-03 17:42     ` Christian Brauner
2021-02-03 18:17       ` Darrick J. Wong
2021-02-04  0:55   ` Shaokun Zhang

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).