f2fs: fix to enable missing ioctl interfaces in ->compat_ioctl
authorChao Yu <chao2.yu@samsung.com>
Tue, 10 Nov 2015 10:44:20 +0000 (18:44 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 4 Dec 2015 19:52:34 +0000 (11:52 -0800)
In 64-bit kernel f2fs can supports 32-bit ioctl system call by identifying
encoded code which is converted from 32-bit one to 64-bit one in
->compat_ioctl.

When we introduced new interfaces in ->ioctl, we forgot to enable them in
->compat_ioctl, so enable them for fixing.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: fix wrongly added spaces together]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/file.c

index b01ad514fbd8728e22de9567e7d49bac19148fc4..904384427ca6f60edea10851c1c623daf669239f 100644 (file)
@@ -257,8 +257,9 @@ static inline bool __has_cursum_space(struct f2fs_summary_block *sum, int size,
 /*
  * ioctl commands in 32 bit emulation
  */
-#define F2FS_IOC32_GETFLAGS             FS_IOC32_GETFLAGS
-#define F2FS_IOC32_SETFLAGS             FS_IOC32_SETFLAGS
+#define F2FS_IOC32_GETFLAGS            FS_IOC32_GETFLAGS
+#define F2FS_IOC32_SETFLAGS            FS_IOC32_SETFLAGS
+#define F2FS_IOC32_GETVERSION          FS_IOC32_GETVERSION
 #endif
 
 struct f2fs_defragment {
index 2f392982c5970f157a5bee91e3201a474605ee78..3f1026caf80772e3dd0caf3f48e537f2a754ee8d 100644 (file)
@@ -1901,6 +1901,22 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case F2FS_IOC32_SETFLAGS:
                cmd = F2FS_IOC_SETFLAGS;
                break;
+       case F2FS_IOC32_GETVERSION:
+               cmd = F2FS_IOC_GETVERSION;
+               break;
+       case F2FS_IOC_START_ATOMIC_WRITE:
+       case F2FS_IOC_COMMIT_ATOMIC_WRITE:
+       case F2FS_IOC_START_VOLATILE_WRITE:
+       case F2FS_IOC_RELEASE_VOLATILE_WRITE:
+       case F2FS_IOC_ABORT_VOLATILE_WRITE:
+       case F2FS_IOC_SHUTDOWN:
+       case F2FS_IOC_SET_ENCRYPTION_POLICY:
+       case F2FS_IOC_GET_ENCRYPTION_PWSALT:
+       case F2FS_IOC_GET_ENCRYPTION_POLICY:
+       case F2FS_IOC_GARBAGE_COLLECT:
+       case F2FS_IOC_WRITE_CHECKPOINT:
+       case F2FS_IOC_DEFRAGMENT:
+               break;
        default:
                return -ENOIOCTLCMD;
        }