diff mbox

loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl

Message ID 20180702230346.72350-1-evgreen@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Evan Green July 2, 2018, 11:03 p.m. UTC
This change adds LOOP_SET_BLOCK_SIZE as one of the supported ioctls
in lo_compat_ioctl. It only takes an unsigned long argument, and
in practice a 32-bit value works fine.

Signed-off-by: Evan Green <evgreen@chromium.org>
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Omar Sandoval July 2, 2018, 11:43 p.m. UTC | #1
On Mon, Jul 02, 2018 at 04:03:46PM -0700, Evan Green wrote:
> This change adds LOOP_SET_BLOCK_SIZE as one of the supported ioctls
> in lo_compat_ioctl. It only takes an unsigned long argument, and
> in practice a 32-bit value works fine.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---
>  drivers/block/loop.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index d6b6f434fd4b..4cb1d1be3cfb 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -1613,6 +1613,7 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
>  		arg = (unsigned long) compat_ptr(arg);
>  	case LOOP_SET_FD:
>  	case LOOP_CHANGE_FD:
> +	case LOOP_SET_BLOCK_SIZE:
>  		err = lo_ioctl(bdev, mode, cmd, arg);
>  		break;
>  	default:
> -- 
> 2.16.4
>
Jens Axboe July 3, 2018, 1:52 p.m. UTC | #2
On 7/2/18 5:03 PM, Evan Green wrote:
> This change adds LOOP_SET_BLOCK_SIZE as one of the supported ioctls
> in lo_compat_ioctl. It only takes an unsigned long argument, and
> in practice a 32-bit value works fine.

Applied for 4.18, thanks.
diff mbox

Patch

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d6b6f434fd4b..4cb1d1be3cfb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1613,6 +1613,7 @@  static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
 		arg = (unsigned long) compat_ptr(arg);
 	case LOOP_SET_FD:
 	case LOOP_CHANGE_FD:
+	case LOOP_SET_BLOCK_SIZE:
 		err = lo_ioctl(bdev, mode, cmd, arg);
 		break;
 	default: