[v3,11/26] ceph: fix compat_ioctl for ceph_dir_operations
diff mbox series

Message ID 20190416202013.4034148-12-arnd@arndb.de
State New
Headers show
Series
  • compat_ioctl: cleanups
Related show

Commit Message

Arnd Bergmann April 16, 2019, 8:19 p.m. UTC
The ceph_ioctl function is used both for files and directories, but only
the files support doing that in 32-bit compat mode.

For consistency, add the same compat handler to the dir operations
as well.

Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/ceph/dir.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Al Viro April 17, 2019, 9:23 p.m. UTC | #1
On Tue, Apr 16, 2019 at 10:19:49PM +0200, Arnd Bergmann wrote:
> The ceph_ioctl function is used both for files and directories, but only
> the files support doing that in 32-bit compat mode.
> 
> For consistency, add the same compat handler to the dir operations
> as well.
> 
> Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/ceph/dir.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index a8f429882249..7c060cb22aa3 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -1785,6 +1785,7 @@ const struct file_operations ceph_dir_fops = {
>  	.open = ceph_open,
>  	.release = ceph_release,
>  	.unlocked_ioctl = ceph_ioctl,
> +	.compat_ioctl = ceph_ioctl,

Again, broken on s390 (and so's the ceph_file_ops, of course).
It wants compat_ptr() applied to argument...
Arnd Bergmann April 17, 2019, 9:31 p.m. UTC | #2
On Wed, Apr 17, 2019 at 11:23 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Tue, Apr 16, 2019 at 10:19:49PM +0200, Arnd Bergmann wrote:
> > The ceph_ioctl function is used both for files and directories, but only
> > the files support doing that in 32-bit compat mode.
> >
> > For consistency, add the same compat handler to the dir operations
> > as well.
> >
> > Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  fs/ceph/dir.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> > index a8f429882249..7c060cb22aa3 100644
> > --- a/fs/ceph/dir.c
> > +++ b/fs/ceph/dir.c
> > @@ -1785,6 +1785,7 @@ const struct file_operations ceph_dir_fops = {
> >       .open = ceph_open,
> >       .release = ceph_release,
> >       .unlocked_ioctl = ceph_ioctl,
> > +     .compat_ioctl = ceph_ioctl,
>
> Again, broken on s390 (and so's the ceph_file_ops, of course).
> It wants compat_ptr() applied to argument...

This gets changed in a later patch, I intentionally left this one
doing the same as ceph_file_fops so the patch can be
backported if necessary, without also backporting the
patch that adds compat_ptr_ioctl.

       Arnd

Patch
diff mbox series

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index a8f429882249..7c060cb22aa3 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1785,6 +1785,7 @@  const struct file_operations ceph_dir_fops = {
 	.open = ceph_open,
 	.release = ceph_release,
 	.unlocked_ioctl = ceph_ioctl,
+	.compat_ioctl = ceph_ioctl,
 	.fsync = ceph_fsync,
 	.lock = ceph_lock,
 	.flock = ceph_flock,