diff mbox series

loop: Add LOOP_SET_DIRECT_IO in compat ioctl

Message ID 20190806220524.251404-1-balsini@android.com (mailing list archive)
State New, archived
Headers show
Series loop: Add LOOP_SET_DIRECT_IO in compat ioctl | expand

Commit Message

Alessio Balsini Aug. 6, 2019, 10:05 p.m. UTC
Export LOOP_SET_DIRECT_IO as additional lo_compat_ioctl.
The input argument for this ioctl is a single long, in the end converted
to a 1-bit boolean. Compatibility is then preserved.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Alessio Balsini <balsini@android.com>
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Joel Fernandes Aug. 6, 2019, 10:25 p.m. UTC | #1
Hi Alessio,

On Tue, Aug 6, 2019 at 6:05 PM Alessio Balsini <balsini@android.com> wrote:
>
> Export LOOP_SET_DIRECT_IO as additional lo_compat_ioctl.
> The input argument for this ioctl is a single long, in the end converted
> to a 1-bit boolean. Compatibility is then preserved.
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Alessio Balsini <balsini@android.com>

This looks Ok to me, but I believe the commit message should also
explain what was this patch "fixing", how was this lack of an "export"
noticed, why does it matter, etc as well.

thanks,

 - Joel


> ---
>  drivers/block/loop.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index 3036883fc9f8..a7461f482467 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -1755,6 +1755,7 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
>         case LOOP_SET_FD:
>         case LOOP_CHANGE_FD:
>         case LOOP_SET_BLOCK_SIZE:
> +       case LOOP_SET_DIRECT_IO:
>                 err = lo_ioctl(bdev, mode, cmd, arg);
>                 break;
>         default:
> --
> 2.22.0.770.g0f2c4a37fd-goog
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>
Alessio Balsini Aug. 6, 2019, 11:57 p.m. UTC | #2
Hi Joel,

I was considering the rationale for this patch totally strightforward:
it enables Direct I/O ioctl to 32 bit processes running on 64 bit
systems for compatibility reasons, as for all the other lo_compat_ioctl
commands.
Also the reason why someone would decide to use Direct I/O with loop
devices is well known, that is why the feature exists :) So I thought
this was another redundant information to put in the commit message and
decided to omit it.

If you still think that I should update the commit message with this
information, I will do so.

Thanks again,
Alessio

On Tue, Aug 06, 2019 at 06:25:42PM -0400, 'Joel Fernandes' via kernel-team wrote:
> Hi Alessio,
> 
> On Tue, Aug 6, 2019 at 6:05 PM Alessio Balsini <balsini@android.com> wrote:
> >
> > Export LOOP_SET_DIRECT_IO as additional lo_compat_ioctl.
> > The input argument for this ioctl is a single long, in the end converted
> > to a 1-bit boolean. Compatibility is then preserved.
> >
> > Cc: Jens Axboe <axboe@kernel.dk>
> > Signed-off-by: Alessio Balsini <balsini@android.com>
> 
> This looks Ok to me, but I believe the commit message should also
> explain what was this patch "fixing", how was this lack of an "export"
> noticed, why does it matter, etc as well.
> 
> thanks,
> 
>  - Joel
> 
> 
> > ---
> >  drivers/block/loop.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> > index 3036883fc9f8..a7461f482467 100644
> > --- a/drivers/block/loop.c
> > +++ b/drivers/block/loop.c
> > @@ -1755,6 +1755,7 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
> >         case LOOP_SET_FD:
> >         case LOOP_CHANGE_FD:
> >         case LOOP_SET_BLOCK_SIZE:
> > +       case LOOP_SET_DIRECT_IO:
> >                 err = lo_ioctl(bdev, mode, cmd, arg);
> >                 break;
> >         default:
> > --
> > 2.22.0.770.g0f2c4a37fd-goog
> >
> > --
> > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
> >
> 
> -- 
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>
Joel Fernandes Aug. 7, 2019, 12:10 a.m. UTC | #3
On Tue, Aug 6, 2019 at 7:57 PM Alessio Balsini <balsini@android.com> wrote:
>
> Hi Joel,
>
> I was considering the rationale for this patch totally straightforward:
> it enables Direct I/O ioctl to 32 bit processes running on 64 bit
> systems for compatibility reasons, as for all the other lo_compat_ioctl
> commands.
> Also the reason why someone would decide to use Direct I/O with loop
> devices is well known, that is why the feature exists :) So I thought
> this was another redundant information to put in the commit message and
> decided to omit it.

No objections from me if maintainers are Ok with it.

> If you still think that I should update the commit message with this
> information, I will do so.

I think you should.

thanks,

 - Joel
diff mbox series

Patch

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3036883fc9f8..a7461f482467 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1755,6 +1755,7 @@  static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
 	case LOOP_SET_FD:
 	case LOOP_CHANGE_FD:
 	case LOOP_SET_BLOCK_SIZE:
+	case LOOP_SET_DIRECT_IO:
 		err = lo_ioctl(bdev, mode, cmd, arg);
 		break;
 	default: