Skip to content

Commit 326eb17

Browse files
committed
md: remove unnecessary test for MD_MAJOR in md_ioctl()
unknown ioctls no longer get this deep into md_ioctl since md_ioctl_valid() was introduced in 3.14. So remove the test and the misleading comment. Signed-off-by: NeilBrown <neilb@suse.de>
1 parent e1960f8 commit 326eb17

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎drivers/md/md.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6559,11 +6559,8 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
65596559
/*
65606560
* The remaining ioctls are changing the state of the
65616561
* superblock, so we do not allow them on read-only arrays.
6562-
* However non-MD ioctls (e.g. get-size) will still come through
6563-
* here and hit the 'default' below, so only disallow
6564-
* 'md' ioctls, and switch to rw mode if started auto-readonly.
65656562
*/
6566-
if (_IOC_TYPE(cmd) == MD_MAJOR && mddev->ro && mddev->pers) {
6563+
if (mddev->ro && mddev->pers) {
65676564
if (mddev->ro == 2) {
65686565
mddev->ro = 0;
65696566
sysfs_notify_dirent_safe(mddev->sysfs_state);

0 commit comments

Comments
 (0)