Skip to content

Commit fc5b94f

Browse files
committed
Merge tag 'block-6.6-2023-10-06' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: "Just two minor fixes, for nbd and md" * tag 'block-6.6-2023-10-06' of git://git.kernel.dk/linux: nbd: don't call blk_mark_disk_dead nbd_clear_sock_ioctl md/raid5: release batch_last before waiting for another stripe_head
2 parents a88c386 + 07a1141 commit fc5b94f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/block/nbd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,9 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd)
14361436

14371437
static void nbd_clear_sock_ioctl(struct nbd_device *nbd)
14381438
{
1439-
blk_mark_disk_dead(nbd->disk);
14401439
nbd_clear_sock(nbd);
1440+
disk_force_media_change(nbd->disk);
1441+
nbd_bdev_reset(nbd);
14411442
if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
14421443
&nbd->config->runtime_flags))
14431444
nbd_config_put(nbd);

drivers/md/raid5.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,13 @@ struct stripe_head *raid5_get_active_stripe(struct r5conf *conf,
854854

855855
set_bit(R5_INACTIVE_BLOCKED, &conf->cache_state);
856856
r5l_wake_reclaim(conf->log, 0);
857+
858+
/* release batch_last before wait to avoid risk of deadlock */
859+
if (ctx && ctx->batch_last) {
860+
raid5_release_stripe(ctx->batch_last);
861+
ctx->batch_last = NULL;
862+
}
863+
857864
wait_event_lock_irq(conf->wait_for_stripe,
858865
is_inactive_blocked(conf, hash),
859866
*(conf->hash_locks + hash));

0 commit comments

Comments
 (0)