Skip to content

Commit 9dd8702

Browse files
Li Nanliu-song-6
authored andcommitted
md: clean up invalid BUG_ON in md_ioctl
'disk->private_data' is set to mddev in md_alloc() and never set to NULL, and users need to open mddev before submitting ioctl. So mddev must not have been freed during ioctl, and there is no need to check mddev here. Clean up it. Signed-off-by: Li Nan <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4e26593 commit 9dd8702

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/md/md.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7622,11 +7622,6 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode,
76227622

76237623
mddev = bdev->bd_disk->private_data;
76247624

7625-
if (!mddev) {
7626-
BUG();
7627-
goto out;
7628-
}
7629-
76307625
/* Some actions do not requires the mutex */
76317626
switch (cmd) {
76327627
case GET_ARRAY_INFO:

0 commit comments

Comments
 (0)