2021-11-09 14:53:44 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
|
|
Date: Tue, 9 Nov 2021 12:01:12 +0100
|
|
|
|
Subject: [PATCH] Revert "block: remove the -ERESTARTSYS handling in
|
|
|
|
blkdev_get_by_dev"
|
|
|
|
|
|
|
|
This reverts commit a8ed1a0607cfa5478ff6009539f44790c4d0956d.
|
|
|
|
|
|
|
|
It breaks ZFS sometimes:
|
|
|
|
https://github.com/openzfs/zfs/issues/12301#issuecomment-873303739
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
|
|
---
|
2021-11-30 17:55:43 +03:00
|
|
|
block/bdev.c | 6 ++++++
|
2021-11-09 14:53:44 +03:00
|
|
|
1 file changed, 6 insertions(+)
|
|
|
|
|
2021-12-14 18:41:56 +03:00
|
|
|
diff --git a/block/bdev.c b/block/bdev.c
|
|
|
|
index 485a258b0ab3..f93165f05987 100644
|
2021-11-30 17:55:43 +03:00
|
|
|
--- a/block/bdev.c
|
|
|
|
+++ b/block/bdev.c
|
2021-12-14 18:41:56 +03:00
|
|
|
@@ -800,6 +800,10 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder)
|
2021-11-09 14:53:44 +03:00
|
|
|
if (ret)
|
|
|
|
return ERR_PTR(ret);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If we lost a race with 'disk' being deleted, try again. See md.c.
|
|
|
|
+ */
|
|
|
|
+retry:
|
|
|
|
bdev = blkdev_get_no_open(dev);
|
|
|
|
if (!bdev)
|
|
|
|
return ERR_PTR(-ENXIO);
|
2021-12-14 18:41:56 +03:00
|
|
|
@@ -852,6 +856,8 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder)
|
2021-11-09 14:53:44 +03:00
|
|
|
disk_unblock_events(disk);
|
|
|
|
put_blkdev:
|
|
|
|
blkdev_put_no_open(bdev);
|
|
|
|
+ if (ret == -ERESTARTSYS)
|
|
|
|
+ goto retry;
|
|
|
|
return ERR_PTR(ret);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(blkdev_get_by_dev);
|