Merge tag 'upstream-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs
Pull UBI and UBIFS updates from Richard Weinberger: - A new interface for UBI to deal better with read disturb - Reject unsupported ioctl flags in UBIFS (xfstests found it) * tag 'upstream-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: wl: Silence uninitialized variable warning ubifs: Reject unsupported ioctl flags explicitly ubi: Expose the bitrot interface ubi: Introduce in_pq()
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
#include <linux/mount.h>
|
||||
#include "ubifs.h"
|
||||
|
||||
/* Need to be kept consistent with checked flags in ioctl2ubifs() */
|
||||
#define UBIFS_SUPPORTED_IOCTL_FLAGS \
|
||||
(FS_COMPR_FL | FS_SYNC_FL | FS_APPEND_FL | \
|
||||
FS_IMMUTABLE_FL | FS_DIRSYNC_FL)
|
||||
|
||||
/**
|
||||
* ubifs_set_inode_flags - set VFS inode flags.
|
||||
* @inode: VFS inode to set flags for
|
||||
@@ -169,6 +174,9 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
if (get_user(flags, (int __user *) arg))
|
||||
return -EFAULT;
|
||||
|
||||
if (flags & ~UBIFS_SUPPORTED_IOCTL_FLAGS)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!S_ISDIR(inode->i_mode))
|
||||
flags &= ~FS_DIRSYNC_FL;
|
||||
|
||||
|
Reference in New Issue
Block a user