From 8a8fcd6a130518866143f330c0dfeca8df4a7881 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 8 Jun 2015 11:40:12 -0400 Subject: [PATCH] add patch try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 --- series | 1 + timestamps | 7 +-- ...e-all-groups-we-can-in-case-of-failure-on-ppc64 | 61 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 diff --git a/series b/series index b242ed19..2a9315ce 100644 --- a/series +++ b/series @@ -27,6 +27,7 @@ only-call-ext4_truncate-when-size-le-isize revert-must-not-fail-allocation-loops-back-to-GFP_NOFAIL verify-block-bitmap-even-after-fresh-initialization +try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 ########################################## # unstable patches diff --git a/timestamps b/timestamps index 3ecbb937..740a28a4 100755 --- a/timestamps +++ b/timestamps @@ -48,6 +48,7 @@ touch -d @1433338419 stable-boundary touch -d @1433621980 only-call-ext4_truncate-when-size-le-isize touch -d @1433775190 revert-must-not-fail-allocation-loops-back-to-GFP_NOFAIL touch -d @1433776732 verify-block-bitmap-even-after-fresh-initialization -touch -d @1433776748 series -touch -d @1433776783 status -touch -d @1433776791 timestamps +touch -d @1433777917 try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 +touch -d @1433777942 series +touch -d @1433777947 status +touch -d @1433778004 timestamps diff --git a/try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 b/try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 new file mode 100644 index 00000000..5cb03551 --- /dev/null +++ b/try-to-initialize-all-groups-we-can-in-case-of-failure-on-ppc64 @@ -0,0 +1,61 @@ +ext4: try to initialize all groups we can in case of failure on ppc64 + +From: Lukas Czerner + +Currently on the machines with page size > block size when initializing +block group buddy cache we initialize it for all the block group bitmaps +in the page. However in the case of read error, checksum error, or if +a single bitmap is in any way corrupted we would fail to initialize all +of the bitmaps. This is problematic because we will not have access to +the other allocation groups even though those might be perfectly fine +and usable. + +Fix this by reading all the bitmaps instead of error out on the first +problem and simply skip the bitmaps which were either not read properly, +or are not valid. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- +v2: remove unnecessary else in condition +v3: nothing changed + + fs/ext4/mballoc.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c +index 8d1e602..df02951 100644 +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -882,10 +882,8 @@ static int ext4_mb_init_cache(struct page *page, char *incore) + + /* wait for I/O completion */ + for (i = 0, group = first_group; i < groups_per_page; i++, group++) { +- if (bh[i] && ext4_wait_block_bitmap(sb, group, bh[i])) { ++ if (bh[i] && ext4_wait_block_bitmap(sb, group, bh[i])) + err = -EIO; +- goto out; +- } + } + + first_block = page->index * blocks_per_page; +@@ -898,6 +896,11 @@ static int ext4_mb_init_cache(struct page *page, char *incore) + /* skip initialized uptodate buddy */ + continue; + ++ if (!buffer_verified(bh[group - first_group])) ++ /* Skip faulty bitmaps */ ++ continue; ++ err = 0; ++ + /* + * data carry information regarding this + * particular group in the format specified +-- +1.8.3.1 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-ext4" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + -- 2.11.4.GIT