Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Tue, 21 Nov 2017 11:34:17
Message-Id: 1511264042.e643729a50271d73aebedf7166075449cb64403a.mpagano@gentoo
1 commit: e643729a50271d73aebedf7166075449cb64403a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 21 11:34:02 2017 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 21 11:34:02 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e643729a
7
8 Add fix for bcache data corruption bug. See bug #638206.
9
10 0000_README | 4 +++
11 ..._bcache-data-corruption-fix-for-bi-partno.patch | 38 ++++++++++++++++++++++
12 2 files changed, 42 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index a8d45fc..5bfe726 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -55,6 +55,10 @@ Patch: 1510_fs-enable-link-security-restrictions-by-default.patch
19 From: http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
20 Desc: Enable link security restrictions by default.
21
22 +Patch: 2100_bcache-data-corruption-fix-for-bi-partno.patch
23 +From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=62530ed8b1d07a45dec94d46e521c0c6c2d476e6
24 +Desc: bio: ensure __bio_clone_fast copies bi_partno.
25 +
26 Patch: 2300_enable-poweroff-on-Mac-Pro-11.patch
27 From: http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git/patch/drivers/pci/quirks.c?id=5080ff61a438f3dd80b88b423e1a20791d8a774c
28 Desc: Workaround to enable poweroff on Mac Pro 11. See bug #601964.
29
30 diff --git a/2100_bcache-data-corruption-fix-for-bi-partno.patch b/2100_bcache-data-corruption-fix-for-bi-partno.patch
31 new file mode 100644
32 index 0000000..dd4aed6
33 --- /dev/null
34 +++ b/2100_bcache-data-corruption-fix-for-bi-partno.patch
35 @@ -0,0 +1,38 @@
36 +From 62530ed8b1d07a45dec94d46e521c0c6c2d476e6 Mon Sep 17 00:00:00 2001
37 +From: Michael Lyle <mlyle@××××.org>
38 +Date: Thu, 16 Nov 2017 23:47:25 -0800
39 +Subject: bio: ensure __bio_clone_fast copies bi_partno
40 +
41 +A new field was introduced in 74d46992e0d9, bi_partno, instead of using
42 +bdev->bd_contains and encoding the partition information in the bi_bdev
43 +field. __bio_clone_fast was changed to copy the disk information, but
44 +not the partition information. At minimum, this regressed bcache and
45 +caused data corruption.
46 +
47 +Signed-off-by: Michael Lyle <mlyle@××××.org>
48 +Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index")
49 +Reported-by: Pavel Goran <via-bcache@×××××××.name>
50 +Reported-by: Campbell Steven <casteven@×××××.com>
51 +Reviewed-by: Coly Li <colyli@××××.de>
52 +Reviewed-by: Ming Lei <ming.lei@××××××.com>
53 +Cc: <stable@×××××××××××.org> # 4.14
54 +Signed-off-by: Jens Axboe <axboe@××××××.dk>
55 +---
56 + block/bio.c | 1 +
57 + 1 file changed, 1 insertion(+)
58 +
59 +diff --git a/block/bio.c b/block/bio.c
60 +index b94a802..459cc85 100644
61 +--- a/block/bio.c
62 ++++ b/block/bio.c
63 +@@ -597,6 +597,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
64 + * so we don't set nor calculate new physical/hw segment counts here
65 + */
66 + bio->bi_disk = bio_src->bi_disk;
67 ++ bio->bi_partno = bio_src->bi_partno;
68 + bio_set_flag(bio, BIO_CLONED);
69 + bio->bi_opf = bio_src->bi_opf;
70 + bio->bi_write_hint = bio_src->bi_write_hint;
71 +--
72 +cgit v1.1
73 +