[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0000000000005289fd060c9b1cb3@google.com>
Date: Fri, 15 Dec 2023 23:03:14 -0800
From: syzbot <syzbot+4da851837827326a7cd4@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [syzbot] Re: [block?] INFO: task hung in bdev_release
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org.
***
Subject: Re: [block?] INFO: task hung in bdev_release
Author: eadavis@...com
please test task hung in bdev_release
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 8c9660f65153
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b6414e1e645b..3cc7993b0b67 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1137,6 +1137,7 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,
int err;
/* Arg will be cast to int, check it to avoid overflow */
+ printk("arg: %d, nbd: %p, %s\n", arg, nbd, __func__);
if (arg > INT_MAX)
return -EINVAL;
sock = nbd_get_socket(nbd, arg, &err);
@@ -1188,10 +1189,12 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,
socks[config->num_connections++] = nsock;
atomic_inc(&config->live_connections);
blk_mq_unfreeze_queue(nbd->disk->queue);
+ printk("arg: %d, nbd: %p, nd: %p, nc: %d, %s\n", arg, nbd, nbd->disk, config->num_connections, __func__);
return 0;
put_socket:
+ printk("nbd: %p, %s\n", nbd, __func__);
blk_mq_unfreeze_queue(nbd->disk->queue);
sockfd_put(sock);
return err;
@@ -1372,6 +1375,7 @@ static int nbd_start_device(struct nbd_device *nbd)
int num_connections = config->num_connections;
int error = 0, i;
+ printk("dev: %p, nc: %d, pid: %d, socks: %p, %s\n", nbd, num_connections, nbd->pid, config->socks, __func__);
if (nbd->pid)
return -EBUSY;
if (!config->socks)
@@ -1425,6 +1429,7 @@ static int nbd_start_device(struct nbd_device *nbd)
args->index = i;
queue_work(nbd->recv_workq, &args->work);
}
+ printk("bs: %lld, blks: %lld, %s\n", config->bytesize, nbd_blksize(config), __func__);
return nbd_set_size(nbd, config->bytesize, nbd_blksize(config));
}
diff --git a/block/bdev.c b/block/bdev.c
index 6f73b02d549c..59a3a23ed281 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -645,6 +645,7 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
int ret;
if (disk->fops->open) {
+ printk(" b: %p, disk: %p, %s\n", bdev, disk, __func__);
ret = disk->fops->open(disk, mode);
if (ret) {
/* avoid ghost partitions on a removed medium */
@@ -660,6 +661,7 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
if (test_bit(GD_NEED_PART_SCAN, &disk->state))
bdev_disk_changed(disk, false);
atomic_inc(&bdev->bd_openers);
+ printk("out, b: %p, disk: %p, %s\n", bdev, disk, __func__);
return 0;
}
@@ -854,24 +856,31 @@ struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
disk_block_events(disk);
+ printk("next om, b: %p, disk: %p, %s\n", bdev, disk, __func__);
mutex_lock(&disk->open_mutex);
ret = -ENXIO;
if (!disk_live(disk))
goto abort_claiming;
+ printk("in1, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (!try_module_get(disk->fops->owner))
goto abort_claiming;
+ printk("in2, b: %p, disk: %p, %s\n", bdev, disk, __func__);
ret = -EBUSY;
if (!bdev_may_open(bdev, mode))
goto abort_claiming;
+ printk("in3, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (bdev_is_partition(bdev))
ret = blkdev_get_part(bdev, mode);
else
ret = blkdev_get_whole(bdev, mode);
+ printk("in4, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (ret)
goto put_module;
bdev_claim_write_access(bdev, mode);
+ printk("in5, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (holder) {
bd_finish_claiming(bdev, holder, hops);
+ printk("in6, b: %p, disk: %p, %s\n", bdev, disk, __func__);
/*
* Block event polling for write claims if requested. Any write
@@ -887,6 +896,7 @@ struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
}
}
mutex_unlock(&disk->open_mutex);
+ printk("out om, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (unblock_events)
disk_unblock_events(disk);
@@ -900,6 +910,7 @@ struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
if (holder)
bd_abort_claiming(bdev, holder);
mutex_unlock(&disk->open_mutex);
+ printk("out om, b: %p, %s\n", bdev, __func__);
disk_unblock_events(disk);
put_blkdev:
blkdev_put_no_open(bdev);
@@ -964,6 +975,7 @@ void bdev_release(struct bdev_handle *handle)
if (atomic_read(&bdev->bd_openers) == 1)
sync_blockdev(bdev);
+ printk("nxt om, b: %p, dk: %p, %s\n", bdev, disk, __func__);
mutex_lock(&disk->open_mutex);
bdev_yield_write_access(bdev, handle->mode);
@@ -982,6 +994,7 @@ void bdev_release(struct bdev_handle *handle)
else
blkdev_put_whole(bdev);
mutex_unlock(&disk->open_mutex);
+ printk("out om, b: %p, dk: %p, %s\n", bdev, disk, __func__);
module_put(disk->fops->owner);
blkdev_put_no_open(bdev);
Powered by blists - more mailing lists