diff options
-rw-r--r-- | fs/ubifs/ioctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 0164bcc827f8..daf9f93e15de 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c | |||
@@ -28,6 +28,11 @@ | |||
28 | #include <linux/mount.h> | 28 | #include <linux/mount.h> |
29 | #include "ubifs.h" | 29 | #include "ubifs.h" |
30 | 30 | ||
31 | /* Need to be kept consistent with checked flags in ioctl2ubifs() */ | ||
32 | #define UBIFS_SUPPORTED_IOCTL_FLAGS \ | ||
33 | (FS_COMPR_FL | FS_SYNC_FL | FS_APPEND_FL | \ | ||
34 | FS_IMMUTABLE_FL | FS_DIRSYNC_FL) | ||
35 | |||
31 | /** | 36 | /** |
32 | * ubifs_set_inode_flags - set VFS inode flags. | 37 | * ubifs_set_inode_flags - set VFS inode flags. |
33 | * @inode: VFS inode to set flags for | 38 | * @inode: VFS inode to set flags for |
@@ -169,6 +174,9 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
169 | if (get_user(flags, (int __user *) arg)) | 174 | if (get_user(flags, (int __user *) arg)) |
170 | return -EFAULT; | 175 | return -EFAULT; |
171 | 176 | ||
177 | if (flags & ~UBIFS_SUPPORTED_IOCTL_FLAGS) | ||
178 | return -EOPNOTSUPP; | ||
179 | |||
172 | if (!S_ISDIR(inode->i_mode)) | 180 | if (!S_ISDIR(inode->i_mode)) |
173 | flags &= ~FS_DIRSYNC_FL; | 181 | flags &= ~FS_DIRSYNC_FL; |
174 | 182 | ||