Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl
@ 2019-08-06 22:05 Alessio Balsini
  2019-08-06 22:25 ` Joel Fernandes
  0 siblings, 1 reply; 7+ messages in thread
From: Alessio Balsini @ 2019-08-06 22:05 UTC (permalink / raw)
  To: linux-block; +Cc: linux-kernel, axboe, dvander, elsk, gregkh, kernel-team

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(+)

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


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

* Re: [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl
  2019-08-06 22:05 [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl Alessio Balsini
@ 2019-08-06 22:25 ` Joel Fernandes
  2019-08-06 23:57   ` Alessio Balsini
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Fernandes @ 2019-08-06 22:25 UTC (permalink / raw)
  To: Alessio Balsini
  Cc: open list:BLOCK LAYER, LKML, Jens Axboe, dvander, Yifan Hong,
	Greg Kroah-Hartman, Cc: Android Kernel

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

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

* Re: [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl
  2019-08-06 22:25 ` Joel Fernandes
@ 2019-08-06 23:57   ` Alessio Balsini
  2019-08-07  0:10     ` Joel Fernandes
  0 siblings, 1 reply; 7+ messages in thread
From: Alessio Balsini @ 2019-08-06 23:57 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: open list:BLOCK LAYER, LKML, Jens Axboe, dvander, Yifan Hong,
	Greg Kroah-Hartman, Cc: Android Kernel

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

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

* Re: [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl
  2019-08-06 23:57   ` Alessio Balsini
@ 2019-08-07  0:10     ` Joel Fernandes
  2019-08-07  0:48       ` [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to " Alessio Balsini
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Fernandes @ 2019-08-07  0:10 UTC (permalink / raw)
  To: Alessio Balsini
  Cc: open list:BLOCK LAYER, LKML, Jens Axboe, dvander, Yifan Hong,
	Greg Kroah-Hartman, Cc: Android Kernel

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

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

* [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to compat ioctl
  2019-08-07  0:10     ` Joel Fernandes
@ 2019-08-07  0:48       ` " Alessio Balsini
  2019-08-08 23:51         ` Joel Fernandes
  2019-08-09  3:39         ` Jens Axboe
  0 siblings, 2 replies; 7+ messages in thread
From: Alessio Balsini @ 2019-08-07  0:48 UTC (permalink / raw)
  To: linux-block
  Cc: linux-kernel, axboe, dvander, elsk, gregkh, joelaf, kernel-team

Enabling Direct I/O with loop devices helps reducing memory usage by
avoiding double caching.  32 bit applications running on 64 bits systems
are currently not able to request direct I/O because is missing from the
lo_compat_ioctl.

This patch fixes the compatibility issue mentioned above by exporting
LOOP_SET_DIRECT_IO as additional lo_compat_ioctl() entry.
The input argument for this ioctl is a single long converted to a 1-bit
boolean, so compatibility is 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(+)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 44c9985f352ab..2e2193f754ab0 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1753,6 +1753,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.23.0.rc1.153.gdeed80330f-goog


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

* Re: [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to compat ioctl
  2019-08-07  0:48       ` [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to " Alessio Balsini
@ 2019-08-08 23:51         ` Joel Fernandes
  2019-08-09  3:39         ` Jens Axboe
  1 sibling, 0 replies; 7+ messages in thread
From: Joel Fernandes @ 2019-08-08 23:51 UTC (permalink / raw)
  To: Alessio Balsini
  Cc: linux-block, linux-kernel, axboe, dvander, elsk, gregkh, kernel-team

On Wed, Aug 07, 2019 at 01:48:28AM +0100, Alessio Balsini wrote:
> Enabling Direct I/O with loop devices helps reducing memory usage by
> avoiding double caching.  32 bit applications running on 64 bits systems
> are currently not able to request direct I/O because is missing from the
> lo_compat_ioctl.
> 
> This patch fixes the compatibility issue mentioned above by exporting
> LOOP_SET_DIRECT_IO as additional lo_compat_ioctl() entry.
> The input argument for this ioctl is a single long converted to a 1-bit
> boolean, so compatibility is preserved.

This commit message looks better now.

thanks,

 - Joel


> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Alessio Balsini <balsini@android.com>
> ---
>  drivers/block/loop.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index 44c9985f352ab..2e2193f754ab0 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -1753,6 +1753,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.23.0.rc1.153.gdeed80330f-goog
> 

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

* Re: [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to compat ioctl
  2019-08-07  0:48       ` [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to " Alessio Balsini
  2019-08-08 23:51         ` Joel Fernandes
@ 2019-08-09  3:39         ` Jens Axboe
  1 sibling, 0 replies; 7+ messages in thread
From: Jens Axboe @ 2019-08-09  3:39 UTC (permalink / raw)
  To: Alessio Balsini, linux-block
  Cc: linux-kernel, dvander, elsk, gregkh, joelaf, kernel-team

On 8/6/19 5:48 PM, Alessio Balsini wrote:
> Enabling Direct I/O with loop devices helps reducing memory usage by
> avoiding double caching.  32 bit applications running on 64 bits systems
> are currently not able to request direct I/O because is missing from the
> lo_compat_ioctl.
> 
> This patch fixes the compatibility issue mentioned above by exporting
> LOOP_SET_DIRECT_IO as additional lo_compat_ioctl() entry.
> The input argument for this ioctl is a single long converted to a 1-bit
> boolean, so compatibility is preserved.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 22:05 [PATCH] loop: Add LOOP_SET_DIRECT_IO in compat ioctl Alessio Balsini
2019-08-06 22:25 ` Joel Fernandes
2019-08-06 23:57   ` Alessio Balsini
2019-08-07  0:10     ` Joel Fernandes
2019-08-07  0:48       ` [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to " Alessio Balsini
2019-08-08 23:51         ` Joel Fernandes
2019-08-09  3:39         ` Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox