summaryrefslogtreecommitdiffstats
path: root/0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch
diff options
context:
space:
mode:
authorJeremy Cline <jcline@redhat.com>2019-12-13 17:11:19 -0500
committerJeremy Cline <jcline@redhat.com>2019-12-13 17:11:19 -0500
commitcaa351c3d61a0219285297c17fbb8c45847e489c (patch)
tree9f280e0816895626c177322ded2d7dd0698a4edd /0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch
parentff218a4ef1fc7a59f77fa3f09f1b46f4629bc12d (diff)
downloadkernel-caa351c3d61a0219285297c17fbb8c45847e489c.tar.gz
kernel-caa351c3d61a0219285297c17fbb8c45847e489c.tar.xz
kernel-caa351c3d61a0219285297c17fbb8c45847e489c.zip
Linux v5.4.3
Diffstat (limited to '0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch')
-rw-r--r--0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch68
1 files changed, 0 insertions, 68 deletions
diff --git a/0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch b/0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch
deleted file mode 100644
index 1e979a1fa..000000000
--- a/0001-bdev-Factor-out-bdev-revalidation-into-a-common-help.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From aea39223667868c77936546004b84716a623a438 Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Mon, 21 Oct 2019 10:37:59 +0200
-Subject: [PATCH 1/2] bdev: Factor out bdev revalidation into a common helper
-
-Factor out code handling revalidation of bdev on disk change into a
-common helper.
-
-Signed-off-by: Jan Kara <jack@suse.cz>
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
----
- fs/block_dev.c | 26 ++++++++++++++------------
- 1 file changed, 14 insertions(+), 12 deletions(-)
-
-diff --git a/fs/block_dev.c b/fs/block_dev.c
-index 9c073dbdc1b0..88c6d35ec71d 100644
---- a/fs/block_dev.c
-+++ b/fs/block_dev.c
-@@ -1512,6 +1512,14 @@ EXPORT_SYMBOL(bd_set_size);
-
- static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
-
-+static void bdev_disk_changed(struct block_device *bdev, bool invalidate)
-+{
-+ if (invalidate)
-+ invalidate_partitions(bdev->bd_disk, bdev);
-+ else
-+ rescan_partitions(bdev->bd_disk, bdev);
-+}
-+
- /*
- * bd_mutex locking:
- *
-@@ -1594,12 +1602,9 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
- * The latter is necessary to prevent ghost
- * partitions on a removed medium.
- */
-- if (bdev->bd_invalidated) {
-- if (!ret)
-- rescan_partitions(disk, bdev);
-- else if (ret == -ENOMEDIUM)
-- invalidate_partitions(disk, bdev);
-- }
-+ if (bdev->bd_invalidated &&
-+ (!ret || ret == -ENOMEDIUM))
-+ bdev_disk_changed(bdev, ret == -ENOMEDIUM);
-
- if (ret)
- goto out_clear;
-@@ -1632,12 +1637,9 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
- if (bdev->bd_disk->fops->open)
- ret = bdev->bd_disk->fops->open(bdev, mode);
- /* the same as first opener case, read comment there */
-- if (bdev->bd_invalidated) {
-- if (!ret)
-- rescan_partitions(bdev->bd_disk, bdev);
-- else if (ret == -ENOMEDIUM)
-- invalidate_partitions(bdev->bd_disk, bdev);
-- }
-+ if (bdev->bd_invalidated &&
-+ (!ret || ret == -ENOMEDIUM))
-+ bdev_disk_changed(bdev, ret == -ENOMEDIUM);
- if (ret)
- goto out_unlock_bdev;
- }
---
-2.21.0
-