Patch "md: clean up invalid BUG_ON in md_ioctl" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    md: clean up invalid BUG_ON in md_ioctl

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     md-clean-up-invalid-bug_on-in-md_ioctl.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5a4e39eef7516ae55ed0dfdbc171d379ccc7aefd
Author: Li Nan <linan122@xxxxxxxxxx>
Date:   Mon Feb 26 11:14:38 2024 +0800

    md: clean up invalid BUG_ON in md_ioctl
    
    [ Upstream commit 9dd8702e7cd28ebf076ff838933f29cf671165ec ]
    
    '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 <linan122@xxxxxxxxxx>
    Reviewed-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240226031444.3606764-4-linan666@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 68eb3220be1c9..6f463eec60b48 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7245,11 +7245,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
 
 	mddev = bdev->bd_disk->private_data;
 
-	if (!mddev) {
-		BUG();
-		goto out;
-	}
-
 	/* Some actions do not requires the mutex */
 	switch (cmd) {
 	case GET_ARRAY_INFO:




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux