]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixed loop-replace-kill_bdev-with-invalidate_bdev.patch in 5.7
authorSasha Levin <sashal@kernel.org>
Sun, 28 Jun 2020 22:13:55 +0000 (18:13 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 28 Jun 2020 22:13:55 +0000 (18:13 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.7/loop-replace-kill_bdev-with-invalidate_bdev.patch
queue-5.7/series

index 7c662c013c939834194479f3105a7dd6014fa52a..cf2d5549cc14fe51d5dd770bdb93ad184c18d341 100644 (file)
@@ -1,11 +1,11 @@
-From f4bd34b139a3fa2808c4205f12714c65e1548c6c Mon Sep 17 00:00:00 2001
-From: Zheng Bin <zhengbin13@huawei.com>
+From f4a15cf999e472fa4646876076ae313e92c775ba Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
 Date: Thu, 18 Jun 2020 12:21:37 +0800
 Subject: loop: replace kill_bdev with invalidate_bdev
 
 From: Zheng Bin <zhengbin13@huawei.com>
 
-commit f4bd34b139a3fa2808c4205f12714c65e1548c6c upstream.
+[ Upstream commit f4bd34b139a3fa2808c4205f12714c65e1548c6c ]
 
 When a filesystem is mounted on a loop device and on a loop ioctl
 LOOP_SET_STATUS64, because of kill_bdev, buffer_head mappings are getting
@@ -31,30 +31,34 @@ Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
 Reviewed-by: Christoph Hellwig <hch@lst.de>
 Reviewed-by: Bart Van Assche <bvanassche@acm.org>
 Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/block/loop.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index c33bbbfd1bd9..475e1a738560 100644
+index da693e6a834e5..418bb4621255a 100644
 --- a/drivers/block/loop.c
 +++ b/drivers/block/loop.c
-@@ -1368,14 +1368,14 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
+@@ -1289,7 +1289,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
+       if (lo->lo_offset != info->lo_offset ||
            lo->lo_sizelimit != info->lo_sizelimit) {
-               size_changed = true;
                sync_blockdev(lo->lo_device);
 -              kill_bdev(lo->lo_device);
 +              invalidate_bdev(lo->lo_device);
        }
  
        /* I/O need to be drained during transfer transition */
-       blk_mq_freeze_queue(lo->lo_queue);
+@@ -1320,7 +1320,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
  
-       if (size_changed && lo->lo_device->bd_inode->i_mapping->nrpages) {
--              /* If any pages were dirtied after kill_bdev(), try again */
-+              /* If any pages were dirtied after invalidate_bdev(), try again */
-               err = -EAGAIN;
-               pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
-                       __func__, lo->lo_number, lo->lo_file_name,
-@@ -1615,11 +1615,11 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
+       if (lo->lo_offset != info->lo_offset ||
+           lo->lo_sizelimit != info->lo_sizelimit) {
+-              /* kill_bdev should have truncated all the pages */
++              /* invalidate_bdev should have truncated all the pages */
+               if (lo->lo_device->bd_inode->i_mapping->nrpages) {
+                       err = -EAGAIN;
+                       pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
+@@ -1565,11 +1565,11 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
                return 0;
  
        sync_blockdev(lo->lo_device);
@@ -68,3 +72,6 @@ index c33bbbfd1bd9..475e1a738560 100644
        if (lo->lo_device->bd_inode->i_mapping->nrpages) {
                err = -EAGAIN;
                pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
+-- 
+2.25.1
+
index c4a53a9d00098cb2a522e4788d946ed8aefe9eb4..dd049b962a1e553b53054652a72cb571292543e1 100644 (file)
@@ -88,4 +88,3 @@ xhci-fix-enumeration-issue-when-setting-max-packet-size-for-fs-devices.patch
 xhci-return-if-xhci-doesn-t-support-lpm.patch
 cdc-acm-add-disable_echo-quirk-for-microchip-smsc-chip.patch
 risc-v-acquire-mmap-lock-before-invoking-walk_page_range.patch
-loop-replace-kill_bdev-with-invalidate_bdev.patch