[PATCH] bcachefs: Correct the FS_IOC_GETFLAGS to FS_IOC32_GETFLAGS in bch2_compat_fs_ioctl()

Youling Tang posted 1 patch 1 year, 7 months ago
fs/bcachefs/fs-ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] bcachefs: Correct the FS_IOC_GETFLAGS to FS_IOC32_GETFLAGS in bch2_compat_fs_ioctl()
Posted by Youling Tang 1 year, 7 months ago
From: Youling Tang <tangyouling@kylinos.cn>

It should be FS_IOC32_GETFLAGS instead of FS_IOC_GETFLAGS in
compat ioctl.

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
 fs/bcachefs/fs-ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
index 3dc8630ff9fe..205a323ffc6d 100644
--- a/fs/bcachefs/fs-ioctl.c
+++ b/fs/bcachefs/fs-ioctl.c
@@ -548,7 +548,7 @@ long bch2_compat_fs_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
 	/* These are just misnamed, they actually get/put from/to user an int */
 	switch (cmd) {
-	case FS_IOC_GETFLAGS:
+	case FS_IOC32_GETFLAGS:
 		cmd = FS_IOC_GETFLAGS;
 		break;
 	case FS_IOC32_SETFLAGS:
-- 
2.34.1
Re: [PATCH] bcachefs: Correct the FS_IOC_GETFLAGS to FS_IOC32_GETFLAGS in bch2_compat_fs_ioctl()
Posted by Kent Overstreet 1 year, 7 months ago
On Tue, Apr 30, 2024 at 11:27:44AM +0800, Youling Tang wrote:
> From: Youling Tang <tangyouling@kylinos.cn>
> 
> It should be FS_IOC32_GETFLAGS instead of FS_IOC_GETFLAGS in
> compat ioctl.

Do we by chance have a test for this?

> 
> Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
> ---
>  fs/bcachefs/fs-ioctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
> index 3dc8630ff9fe..205a323ffc6d 100644
> --- a/fs/bcachefs/fs-ioctl.c
> +++ b/fs/bcachefs/fs-ioctl.c
> @@ -548,7 +548,7 @@ long bch2_compat_fs_ioctl(struct file *file, unsigned cmd, unsigned long arg)
>  {
>  	/* These are just misnamed, they actually get/put from/to user an int */
>  	switch (cmd) {
> -	case FS_IOC_GETFLAGS:
> +	case FS_IOC32_GETFLAGS:
>  		cmd = FS_IOC_GETFLAGS;
>  		break;
>  	case FS_IOC32_SETFLAGS:
> -- 
> 2.34.1
>
Re: [PATCH] bcachefs: Correct the FS_IOC_GETFLAGS to FS_IOC32_GETFLAGS in bch2_compat_fs_ioctl()
Posted by Youling Tang 1 year, 7 months ago
On 30/04/2024 11:29, Kent Overstreet wrote:
> On Tue, Apr 30, 2024 at 11:27:44AM +0800, Youling Tang wrote:
>> From: Youling Tang <tangyouling@kylinos.cn>
>>
>> It should be FS_IOC32_GETFLAGS instead of FS_IOC_GETFLAGS in
>> compat ioctl.
> Do we by chance have a test for this?

Just reading the code found this out.


>
>> Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
>> ---
>>   fs/bcachefs/fs-ioctl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
>> index 3dc8630ff9fe..205a323ffc6d 100644
>> --- a/fs/bcachefs/fs-ioctl.c
>> +++ b/fs/bcachefs/fs-ioctl.c
>> @@ -548,7 +548,7 @@ long bch2_compat_fs_ioctl(struct file *file, unsigned cmd, unsigned long arg)
>>   {
>>   	/* These are just misnamed, they actually get/put from/to user an int */
>>   	switch (cmd) {
>> -	case FS_IOC_GETFLAGS:
>> +	case FS_IOC32_GETFLAGS:
>>   		cmd = FS_IOC_GETFLAGS;
>>   		break;
>>   	case FS_IOC32_SETFLAGS:
>> -- 
>> 2.34.1
>>