Skip to contentSkip to conversation

loop: Add LOOP_SET_DIRECT_IO in compat ioctl

PATCH Superseded Alessio Balsini 4 participants 7 messages Aug 6, 2019 – Aug 9, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loop: Add LOOP_SET_DIRECT_IO in compat ioctl

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.

---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -0
index 3036883fc9f8..a7461f482467 100644
@@ -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:
Signature · 1 line
2.22.0.770.g0f2c4a37fd-goog
#1 lore raw

Hi Alessio,

Quoted 7 lines · Alessio Balsini

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.

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

Quoted 22 lines
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -1
index 3036883fc9f8..a7461f482467 100644
@@ -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 [email protected].

#2 lore raw

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

Quoted 46 lines · Joel Fernandes' via kernel-team

Hi Alessio,

Quoted 7 lines · Alessio Balsini

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.

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

Quoted 22 lines
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -1
index 3036883fc9f8..a7461f482467 100644
@@ -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 [email protected].

Signature · 1 line
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
#3 lore raw
Quoted 11 lines · Alessio Balsini

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.

Quoted 2 lines

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

I think you should.

thanks,

- Joel

#4 lore raw

PATCH v2 1/1 loop: Add LOOP_SET_DIRECT_IO to compat ioctl

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.

---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -0
index 44c9985f352ab..2e2193f754ab0 100644
@@ -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:
Signature · 1 line
2.23.0.rc1.153.gdeed80330f-goog
#5 lore raw

Re: [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to compat ioctl

Quoted 9 lines · Alessio Balsini

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

Quoted 21 lines
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -0
index 44c9985f352ab..2e2193f754ab0 100644
@@ -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:
Signature · 1 line
2.23.0.rc1.153.gdeed80330f-goog
maintainer Applied
#6 lore raw

Re: [PATCH v2] loop: Add LOOP_SET_DIRECT_IO to compat ioctl

In reply to Alessio Balsini
Quoted 9 lines · Alessio Balsini

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.

Signature · 1 line
Jens Axboe