Message ID | 20221103025541.1875809-2-yukuai1@huaweicloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: bugfix for bd_link_disk_holder() | expand |
Yes, this is a good one. Please add a single sentence blurb explaing the issue before the Test prodecure? With that this looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> On Thu, Nov 03, 2022 at 10:55:40AM +0800, Yu Kuai wrote: > From: Yu Kuai <yukuai3@huawei.com> > > Test procedures: > > 1) dmsetup create test --table "xxx sda", assume dm-0 is created > 2) dmsetup suspend test > 3) dmsetup reload test --table "xxx dm-0" > 4) dmsetup resume test Can you wire this up for blocktests? I've also been wondering how we could wire your other two test cases up as I think they'be very useful. Hopefully I can find some time to inject delays with eBPF or something like it.
Hi, 在 2022/11/03 16:06, Christoph Hellwig 写道: > Yes, this is a good one. Please add a single sentence blurb explaing > the issue before the Test prodecure? Ok, I'll do that. > > With that this looks good: > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > On Thu, Nov 03, 2022 at 10:55:40AM +0800, Yu Kuai wrote: >> From: Yu Kuai <yukuai3@huawei.com> >> >> Test procedures: >> >> 1) dmsetup create test --table "xxx sda", assume dm-0 is created >> 2) dmsetup suspend test >> 3) dmsetup reload test --table "xxx dm-0" >> 4) dmsetup resume test > > Can you wire this up for blocktests? Of course I can, I'm not very familiar with how to add new test in blktests, so I might take some time to do that. > > I've also been wondering how we could wire your other two test cases > up as I think they'be very useful. Hopefully I can find some time > to inject delays with eBPF or something like it. The problem was found without the delay originally, such delay can make sure the problem is reproduced 100%, but it's still possible without the delay. Perhaps we can add the test without delay for now. Thanks, Kuai > > . >
diff --git a/block/holder.c b/block/holder.c index 5283bc804cc1..5fc68238ce3a 100644 --- a/block/holder.c +++ b/block/holder.c @@ -75,6 +75,9 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) struct bd_holder_disk *holder; int ret = 0; + if (bdev->bd_disk == disk) + return -EINVAL; + mutex_lock(&disk->open_mutex); WARN_ON_ONCE(!bdev->bd_holder);