Skip to contentSkip to conversation

nilfs2: unbreak compat ioctl

PATCH In review Thomas Meyer 2 participants 4 messages Nov 7, 2011 – Nov 14, 2011 NILFS2 filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs2: unbreak compat ioctl

I guess commit 828b1c50ae11e6dda68f8dfefe43b74c7182b157 incidentally broke all other compat ioctls. make them work again.

---
 fs/nilfs2/ioctl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nilfs2/ioctl.c +0 -2
index 41d6743..1773a98 100644
@@ -842,8 +842,6 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_GETVERSION:
 		cmd = FS_IOC_GETVERSION;
 		break;
-	default:
-		return -ENOIOCTLCMD;
 	}
 	return nilfs_ioctl(filp, cmd, (unsigned long)compat_ptr(arg));
 }
Signature · 1 line
1.7.7
#1 lore raw
Quoted 23 lines · Thomas Meyer

I guess commit 828b1c50ae11e6dda68f8dfefe43b74c7182b157 incidentally broke all other compat ioctls. make them work again.

---
 fs/nilfs2/ioctl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nilfs2/ioctl.c +0 -2
index 41d6743..1773a98 100644
@@ -842,8 +842,6 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_GETVERSION:
 		cmd = FS_IOC_GETVERSION;
 		break;
-	default:
-		return -ENOIOCTLCMD;
 	}
 	return nilfs_ioctl(filp, cmd, (unsigned long)compat_ptr(arg));
 }
Signature · 1 line
1.7.7

Hi, thank you for pointing this out.

But, this patch looks to prevent compat_sys_ioctl() from handling other compatible ioctls that compat_ioctl_check_table function detects. For instance, fiemap (FS_IOC_FIEMAP) is handled via the function.

I think we should only redirect own ioctl commands (i.e. NILFS_IOCTL_xxxx) to the nilfs_ioctl() call.

Regards,
Ryusuke Konishi
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Am Donnerstag, den 10.11.2011, 12:49 +0900 schrieb Ryusuke Konishi:

Quoted 7 lines

But, this patch looks to prevent compat_sys_ioctl() from handling other compatible ioctls that compat_ioctl_check_table function detects. For instance, fiemap (FS_IOC_FIEMAP) is handled via the function.

I think we should only redirect own ioctl commands (i.e. NILFS_IOCTL_xxxx) to the nilfs_ioctl() call.

Hello Ryusuke,

something like this?

kind regards
thomas

From 241cc9e8c7d6b8218d307117b0d4a0dabbe1d94e Mon Sep 17 00:00:00 2001
From: Thomas Meyer <[email protected]>
Date: Mon, 7 Nov 2011 20:59:02 +0100
Subject: [PATCH] nilfs2: unbreak compat ioctl

I guess commit 828b1c50ae11e6dda68f8dfefe43b74c7182b157 incidentally broke all other NILFS compat ioctls. make them work again.

---
 fs/nilfs2/ioctl.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
fs/nilfs2/ioctl.c +13 -0
index 41d6743..3e65427 100644
@@ -842,6 +842,19 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_GETVERSION:
 		cmd = FS_IOC_GETVERSION;
 		break;
+	case NILFS_IOCTL_CHANGE_CPMODE:
+	case NILFS_IOCTL_DELETE_CHECKPOINT:
+	case NILFS_IOCTL_GET_CPINFO:
+	case NILFS_IOCTL_GET_CPSTAT:
+	case NILFS_IOCTL_GET_SUINFO:
+	case NILFS_IOCTL_GET_SUSTAT:
+	case NILFS_IOCTL_GET_VINFO:
+	case NILFS_IOCTL_GET_BDESCS:
+	case NILFS_IOCTL_CLEAN_SEGMENTS:
+	case NILFS_IOCTL_SYNC:
+	case NILFS_IOCTL_RESIZE:
+	case NILFS_IOCTL_SET_ALLOC_RANGE:
+		break;
 	default:
 		return -ENOIOCTLCMD;
 	}
Signature · 7 lines
1.7.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 6 lines · Thomas Meyer

Am Donnerstag, den 10.11.2011, 12:49 +0900 schrieb Ryusuke Konishi:

Quoted 5 lines

But, this patch looks to prevent compat_sys_ioctl() from handling other compatible ioctls that compat_ioctl_check_table function detects. For instance, fiemap (FS_IOC_FIEMAP) is handled via the function.

Quoted 6 lines
Quoted 2 lines

I think we should only redirect own ioctl commands (i.e. NILFS_IOCTL_xxxx) to the nilfs_ioctl() call.

Hello Ryusuke,

something like this?

Thanks, it looks fine to me.

I'll send it upstream after testing it against a 64-bit kernel environment with a 32-bit userspace.

Regards,
Ryusuke Konishi

Quoted 49 lines

kind regards
thomas

From 241cc9e8c7d6b8218d307117b0d4a0dabbe1d94e Mon Sep 17 00:00:00 2001
From: Thomas Meyer <[email protected]>
Date: Mon, 7 Nov 2011 20:59:02 +0100
Subject: [PATCH] nilfs2: unbreak compat ioctl

I guess commit 828b1c50ae11e6dda68f8dfefe43b74c7182b157 incidentally broke all other NILFS compat ioctls. make them work again.

---
 fs/nilfs2/ioctl.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
fs/nilfs2/ioctl.c +13 -0
index 41d6743..3e65427 100644
@@ -842,6 +842,19 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	case FS_IOC32_GETVERSION:
 		cmd = FS_IOC_GETVERSION;
 		break;
+	case NILFS_IOCTL_CHANGE_CPMODE:
+	case NILFS_IOCTL_DELETE_CHECKPOINT:
+	case NILFS_IOCTL_GET_CPINFO:
+	case NILFS_IOCTL_GET_CPSTAT:
+	case NILFS_IOCTL_GET_SUINFO:
+	case NILFS_IOCTL_GET_SUSTAT:
+	case NILFS_IOCTL_GET_VINFO:
+	case NILFS_IOCTL_GET_BDESCS:
+	case NILFS_IOCTL_CLEAN_SEGMENTS:
+	case NILFS_IOCTL_SYNC:
+	case NILFS_IOCTL_RESIZE:
+	case NILFS_IOCTL_SET_ALLOC_RANGE:
+		break;
 	default:
 		return -ENOIOCTLCMD;
 	}
Signature · 8 lines
1.7.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html