From: Greg Kroah-Hartman Date: Tue, 7 Aug 2018 13:50:01 +0000 (+0200) Subject: 4.17-stable patches X-Git-Tag: v4.17.14~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d79b5bfcec42c42755284d94437396e58db42f8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.17-stable patches added patches: partially-revert-block-fail-op_is_write-requests-to-read-only-partitions.patch --- diff --git a/queue-4.17/partially-revert-block-fail-op_is_write-requests-to-read-only-partitions.patch b/queue-4.17/partially-revert-block-fail-op_is_write-requests-to-read-only-partitions.patch new file mode 100644 index 00000000000..602d02e42d6 --- /dev/null +++ b/queue-4.17/partially-revert-block-fail-op_is_write-requests-to-read-only-partitions.patch @@ -0,0 +1,86 @@ +From a32e236eb93e62a0f692e79b7c3c9636689559b9 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Fri, 3 Aug 2018 12:22:09 -0700 +Subject: Partially revert "block: fail op_is_write() requests to read-only partitions" + +From: Linus Torvalds + +commit a32e236eb93e62a0f692e79b7c3c9636689559b9 upstream. + +It turns out that commit 721c7fc701c7 ("block: fail op_is_write() +requests to read-only partitions"), while obviously correct, causes +problems for some older lvm2 installations. + +The reason is that the lvm snapshotting will continue to write to the +snapshow COW volume, even after the volume has been marked read-only. +End result: snapshot failure. + +This has actually been fixed in newer version of the lvm2 tool, but the +old tools still exist, and the breakage was reported both in the kernel +bugzilla and in the Debian bugzilla: + + https://bugzilla.kernel.org/show_bug.cgi?id=200439 + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900442 + +The lvm2 fix is here + + https://sourceware.org/git/?p=lvm2.git;a=commit;h=a6fdb9d9d70f51c49ad11a87ab4243344e6701a3 + +but until everybody has updated to recent versions, we'll have to weaken +the "never write to read-only partitions" check. It now allows the +write to happen, but causes a warning, something like this: + + generic_make_request: Trying to write to read-only block-device dm-3 (partno X) + Modules linked in: nf_tables xt_cgroup xt_owner kvm_intel iwlmvm kvm irqbypass iwlwifi + CPU: 1 PID: 77 Comm: kworker/1:1 Not tainted 4.17.9-gentoo #3 + Hardware name: LENOVO 20B6A019RT/20B6A019RT, BIOS GJET91WW (2.41 ) 09/21/2016 + Workqueue: ksnaphd do_metadata + RIP: 0010:generic_make_request_checks+0x4ac/0x600 + ... + Call Trace: + generic_make_request+0x64/0x400 + submit_bio+0x6c/0x140 + dispatch_io+0x287/0x430 + sync_io+0xc3/0x120 + dm_io+0x1f8/0x220 + do_metadata+0x1d/0x30 + process_one_work+0x1b9/0x3e0 + worker_thread+0x2b/0x3c0 + kthread+0x113/0x130 + ret_from_fork+0x35/0x40 + +Note that this is a "revert" in behavior only. I'm leaving alone the +actual code cleanups in commit 721c7fc701c7, but letting the previously +uncaught request go through with a warning instead of stopping it. + +Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions") +Reported-and-tested-by: WGH +Acked-by: Mike Snitzer +Cc: Sagi Grimberg +Cc: Ilya Dryomov +Cc: Jens Axboe +Cc: Zdenek Kabelac +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-core.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -2174,11 +2174,12 @@ static inline bool bio_check_ro(struct b + if (part->policy && op_is_write(bio_op(bio))) { + char b[BDEVNAME_SIZE]; + +- printk(KERN_ERR ++ WARN_ONCE(1, + "generic_make_request: Trying to write " + "to read-only block-device %s (partno %d)\n", + bio_devname(bio, b), part->partno); +- return true; ++ /* Older lvm-tools actually trigger this */ ++ return false; + } + + return false; diff --git a/queue-4.17/series b/queue-4.17/series index 103139ba64b..3b525c772b1 100644 --- a/queue-4.17/series +++ b/queue-4.17/series @@ -13,3 +13,4 @@ xfs-more-robust-inode-extent-count-validation.patch ring_buffer-tracing-inherit-the-tracing-setting-to-next-ring-buffer.patch i2c-imx-fix-reinit_completion-use.patch btrfs-fix-file-data-corruption-after-cloning-a-range-and-fsync.patch +partially-revert-block-fail-op_is_write-requests-to-read-only-partitions.patch