From 37d7aadc566e9bbcfa556bd7b994b57a38d1f01f Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 28 Jun 2020 18:13:55 -0400 Subject: [PATCH] Fixed loop-replace-kill_bdev-with-invalidate_bdev.patch in 5.7 Signed-off-by: Sasha Levin --- ...place-kill_bdev-with-invalidate_bdev.patch | 37 +++++++++++-------- queue-5.7/series | 1 - 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/queue-5.7/loop-replace-kill_bdev-with-invalidate_bdev.patch b/queue-5.7/loop-replace-kill_bdev-with-invalidate_bdev.patch index 7c662c013c9..cf2d5549cc1 100644 --- a/queue-5.7/loop-replace-kill_bdev-with-invalidate_bdev.patch +++ b/queue-5.7/loop-replace-kill_bdev-with-invalidate_bdev.patch @@ -1,11 +1,11 @@ -From f4bd34b139a3fa2808c4205f12714c65e1548c6c Mon Sep 17 00:00:00 2001 -From: Zheng Bin +From f4a15cf999e472fa4646876076ae313e92c775ba Mon Sep 17 00:00:00 2001 +From: Sasha Levin Date: Thu, 18 Jun 2020 12:21:37 +0800 Subject: loop: replace kill_bdev with invalidate_bdev From: Zheng Bin -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 Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.7/series b/queue-5.7/series index c4a53a9d000..dd049b962a1 100644 --- a/queue-5.7/series +++ b/queue-5.7/series @@ -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 -- 2.47.3