[ Sasha's backport helper bot ] Hi, The upstream commit SHA1 provided is correct: a2db328b0839312c169eb42746ec46fc1ab53ed2 WARNING: Author mismatch between patch and upstream commit: Backport author: Xiangyu Chen <xiangyu.chen@xxxxxxxxxxxxxxxxx> Commit author: Yu Kuai <yukuai3@xxxxxxxxxx> Status in newer kernel trees: 6.11.y | Present (exact SHA1) 6.6.y | Present (different SHA1: aaadb755f2d6) 6.1.y | Not found Note: The patch differs from the upstream commit: --- --- - 2024-11-20 07:45:51.467026214 -0500 +++ /tmp/tmp.d9kjHboEiG 2024-11-20 07:45:51.459443624 -0500 @@ -1,3 +1,5 @@ +[ Upstream commit a2db328b0839312c169eb42746ec46fc1ab53ed2 ] + Writing 'power' and 'submit_queues' concurrently will trigger kernel panic: @@ -49,15 +51,17 @@ Reviewed-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxx> Link: https://lore.kernel.org/r/20240523153934.1937851-1-yukuai1@xxxxxxxxxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> +Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> +Signed-off-by: Xiangyu Chen <xiangyu.chen@xxxxxxxxxxxxx> --- drivers/block/null_blk/main.c | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c -index 5d56ad4ce01a1..eb023d2673693 100644 +index f58778b57375..e838eed4aacf 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c -@@ -413,13 +413,25 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev, +@@ -392,13 +392,25 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev, static int nullb_apply_submit_queues(struct nullb_device *dev, unsigned int submit_queues) { @@ -85,7 +89,7 @@ } NULLB_DEVICE_ATTR(size, ulong, NULL); -@@ -468,28 +480,31 @@ static ssize_t nullb_device_power_store(struct config_item *item, +@@ -444,28 +456,31 @@ static ssize_t nullb_device_power_store(struct config_item *item, if (ret < 0) return ret; @@ -122,25 +126,25 @@ } CONFIGFS_ATTR(nullb_device_, power); -@@ -1932,15 +1947,12 @@ static int null_add_dev(struct nullb_device *dev) - nullb->q->queuedata = nullb; +@@ -2102,15 +2117,12 @@ static int null_add_dev(struct nullb_device *dev) blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q); + blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, nullb->q); - mutex_lock(&lock); rv = ida_alloc(&nullb_indexes, GFP_KERNEL); - if (rv < 0) { - mutex_unlock(&lock); + if (rv < 0) - goto out_cleanup_disk; + goto out_cleanup_zone; - } + nullb->index = rv; dev->index = rv; - mutex_unlock(&lock); - if (config_item_name(&dev->group.cg_item)) { - /* Use configfs dir name as the device name */ -@@ -1969,9 +1981,7 @@ static int null_add_dev(struct nullb_device *dev) + blk_queue_logical_block_size(nullb->q, dev->blocksize); + blk_queue_physical_block_size(nullb->q, dev->blocksize); +@@ -2134,9 +2146,7 @@ static int null_add_dev(struct nullb_device *dev) if (rv) goto out_ida_free; @@ -150,7 +154,7 @@ pr_info("disk %s created\n", nullb->disk_name); -@@ -2020,7 +2030,9 @@ static int null_create_dev(void) +@@ -2185,7 +2195,9 @@ static int null_create_dev(void) if (!dev) return -ENOMEM; @@ -160,3 +164,6 @@ if (ret) { null_free_dev(dev); return ret; +-- +2.43.0 + --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |