From: syzbot <syzbot+4da851837827326a7cd4@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [block?] INFO: task hung in bdev_release
Date: Sat, 16 Dec 2023 03:37:03 -0800 [thread overview]
Message-ID: <00000000000085da1f060c9eefc4@google.com> (raw)
In-Reply-To: <000000000000098af2060b5ff161@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [block?] INFO: task hung in bdev_release
Author: eadavis@qq.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/block/bdev.c b/block/bdev.c
index 6f73b02d549c..06ce1a73b4d0 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -646,11 +646,13 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
if (disk->fops->open) {
ret = disk->fops->open(disk, mode);
+ printk("r: %d, b: %p, disk: %p, %s\n", ret, bdev, disk, __func__);
if (ret) {
/* avoid ghost partitions on a removed medium */
if (ret == -ENOMEDIUM &&
test_bit(GD_NEED_PART_SCAN, &disk->state))
bdev_disk_changed(disk, true);
+ printk("r: %d, b: %p, disk: %p, %s\n", ret, bdev, disk, __func__);
return ret;
}
}
@@ -660,6 +662,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;
}
@@ -863,10 +866,12 @@ struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
ret = -EBUSY;
if (!bdev_may_open(bdev, mode))
goto abort_claiming;
+ printk("in1, b: %p, disk: %p, h: %p, %s\n", bdev, disk, holder, __func__);
if (bdev_is_partition(bdev))
ret = blkdev_get_part(bdev, mode);
else
ret = blkdev_get_whole(bdev, mode);
+ printk("in2, b: %p, disk: %p, %s\n", bdev, disk, __func__);
if (ret)
goto put_module;
bdev_claim_write_access(bdev, mode);
@@ -887,6 +892,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 +906,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 +971,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 +990,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);
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b6414e1e645b..090cdef5899d 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));
}
@@ -1596,6 +1601,7 @@ static int nbd_open(struct gendisk *disk, blk_mode_t mode)
struct nbd_config *config;
int ret = 0;
+ printk("d: %p, %s\n", disk, __func__);
mutex_lock(&nbd_index_mutex);
nbd = disk->private_data;
if (!nbd) {
@@ -1629,6 +1635,7 @@ static int nbd_open(struct gendisk *disk, blk_mode_t mode)
set_bit(GD_NEED_PART_SCAN, &disk->state);
}
out:
+ printk("ret: %d, out, d: %p, %s\n", ret, disk, __func__);
mutex_unlock(&nbd_index_mutex);
return ret;
}
next prev parent reply other threads:[~2023-12-16 11:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 15:02 [syzbot] [block?] INFO: task hung in bdev_release syzbot
2023-12-16 4:17 ` syzbot
2023-12-16 5:41 ` Hillf Danton
2023-12-16 6:22 ` syzbot
2023-12-16 7:03 ` [syzbot] " syzbot
2023-12-16 11:37 ` syzbot [this message]
2023-12-16 12:15 ` [syzbot] " syzbot
2023-12-16 13:02 ` syzbot
2023-12-17 3:11 ` syzbot
2023-12-17 5:22 ` syzbot
2023-12-17 8:34 ` [PATCH next] nbd: fix " Edward Adam Davis
[not found] <tencent_E74A0E747D762B66DA3C9D36FE9698367C09@qq.com>
2023-12-16 5:35 ` [syzbot] [block?] INFO: " syzbot
[not found] <tencent_9E4FE88DAB25DF0DED9279DDA9DD94196D07@qq.com>
2023-12-16 8:41 ` syzbot
[not found] <tencent_B69624EA1EECC2CD2C79FE6F942DA16D980A@qq.com>
2023-12-16 12:01 ` syzbot
[not found] <tencent_956C25D8BA0BBB79331B9E4D1B254B751B08@qq.com>
2023-12-16 12:33 ` syzbot
[not found] <tencent_82482E1D6F90963CE8E2EF9ACD6079866D0A@qq.com>
2023-12-16 13:31 ` syzbot
[not found] <tencent_FC33DA9E731BEF4B621B55255CBA2CBB7808@qq.com>
2023-12-17 4:06 ` syzbot
[not found] <tencent_3790AEE86ED1CC91A7DF06C852D3C650C906@qq.com>
2023-12-17 6:57 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00000000000085da1f060c9eefc4@google.com \
--to=syzbot+4da851837827326a7cd4@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.