From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Eric Sandeen <sandeen@sandeen.net>
Subject: Re: [PATCH 1/2] xfs: fall back to native ioctls for unhandled compat ones
Date: Fri, 16 Aug 2019 18:42:06 -0700 [thread overview]
Message-ID: <20190817014206.GC752159@magnolia> (raw)
In-Reply-To: <20190816063547.1592-2-hch@lst.de>
On Fri, Aug 16, 2019 at 08:35:46AM +0200, Christoph Hellwig wrote:
> Always try the native ioctl if we don't have a compat handler. This
> removes a lot of boilerplate code as 'modern' ioctls should generally
> be compat clean, and fixes the missing entries for the recently added
> FS_IOC_GETFSLABEL/FS_IOC_SETFSLABEL ioctls.
>
> Fixes: f7664b31975b ("xfs: implement online get/set fs label")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_ioctl32.c | 54 ++------------------------------------------
> 1 file changed, 2 insertions(+), 52 deletions(-)
>
> diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
> index 7fcf7569743f..bae08ef92ac3 100644
> --- a/fs/xfs/xfs_ioctl32.c
> +++ b/fs/xfs/xfs_ioctl32.c
> @@ -553,57 +553,6 @@ xfs_file_compat_ioctl(
> trace_xfs_file_compat_ioctl(ip);
>
> switch (cmd) {
> - /* No size or alignment issues on any arch */
> - case XFS_IOC_DIOINFO:
> - case XFS_IOC_FSGEOMETRY_V4:
> - case XFS_IOC_FSGEOMETRY:
> - case XFS_IOC_AG_GEOMETRY:
> - case XFS_IOC_FSGETXATTR:
> - case XFS_IOC_FSSETXATTR:
> - case XFS_IOC_FSGETXATTRA:
> - case XFS_IOC_FSSETDM:
> - case XFS_IOC_GETBMAP:
> - case XFS_IOC_GETBMAPA:
> - case XFS_IOC_GETBMAPX:
> - case XFS_IOC_FSCOUNTS:
> - case XFS_IOC_SET_RESBLKS:
> - case XFS_IOC_GET_RESBLKS:
> - case XFS_IOC_FSGROWFSLOG:
> - case XFS_IOC_GOINGDOWN:
> - case XFS_IOC_ERROR_INJECTION:
> - case XFS_IOC_ERROR_CLEARALL:
> - case FS_IOC_GETFSMAP:
> - case XFS_IOC_SCRUB_METADATA:
> - case XFS_IOC_BULKSTAT:
> - case XFS_IOC_INUMBERS:
> - return xfs_file_ioctl(filp, cmd, p);
> -#if !defined(BROKEN_X86_ALIGNMENT) || defined(CONFIG_X86_X32)
> - /*
> - * These are handled fine if no alignment issues. To support x32
> - * which uses native 64-bit alignment we must emit these cases in
> - * addition to the ia-32 compat set below.
> - */
> - case XFS_IOC_ALLOCSP:
> - case XFS_IOC_FREESP:
> - case XFS_IOC_RESVSP:
> - case XFS_IOC_UNRESVSP:
> - case XFS_IOC_ALLOCSP64:
> - case XFS_IOC_FREESP64:
> - case XFS_IOC_RESVSP64:
> - case XFS_IOC_UNRESVSP64:
> - case XFS_IOC_FSGEOMETRY_V1:
> - case XFS_IOC_FSGROWFSDATA:
> - case XFS_IOC_FSGROWFSRT:
> - case XFS_IOC_ZERO_RANGE:
> -#ifdef CONFIG_X86_X32
> - /*
> - * x32 special: this gets a different cmd number from the ia-32 compat
> - * case below; the associated data will match native 64-bit alignment.
> - */
> - case XFS_IOC_SWAPEXT:
> -#endif
> - return xfs_file_ioctl(filp, cmd, p);
> -#endif
> #if defined(BROKEN_X86_ALIGNMENT)
> case XFS_IOC_ALLOCSP_32:
> case XFS_IOC_FREESP_32:
> @@ -705,6 +654,7 @@ xfs_file_compat_ioctl(
> case XFS_IOC_FSSETDM_BY_HANDLE_32:
> return xfs_compat_fssetdm_by_handle(filp, arg);
> default:
> - return -ENOIOCTLCMD;
> + /* try the native version */
> + return xfs_file_ioctl(filp, cmd, p);
> }
> }
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-08-17 1:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-16 6:35 xfs compat ioctls fixlets Christoph Hellwig
2019-08-16 6:35 ` [PATCH 1/2] xfs: fall back to native ioctls for unhandled compat ones Christoph Hellwig
2019-08-16 13:51 ` Eric Sandeen
2019-08-17 1:42 ` Darrick J. Wong [this message]
2019-08-16 6:35 ` [PATCH 2/2] xfs: compat_ioctl: use compat_ptr() Christoph Hellwig
2019-08-16 14:05 ` Eric Sandeen
2019-08-17 1:42 ` Darrick J. Wong
2019-08-18 8:35 ` Christoph Hellwig
2019-08-19 16:42 ` Darrick J. Wong
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=20190817014206.GC752159@magnolia \
--to=darrick.wong@oracle.com \
--cc=arnd@arndb.de \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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