Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636593 > unrolled thread

[PATCH 3.18 04/68] md:raid1: fix a dead loop when read from a WriteMostly disk

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-05-05 20:40 +0200
Last post2017-05-05 20:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.18 04/68] md:raid1: fix a dead loop when read from a WriteMostly disk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-05 20:40 +0200

#1636593 — [PATCH 3.18 04/68] md:raid1: fix a dead loop when read from a WriteMostly disk

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-05 20:40 +0200
Subject[PATCH 3.18 04/68] md:raid1: fix a dead loop when read from a WriteMostly disk
Message-ID<tDQj3-5qv-89@gated-at.bofh.it>
3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wei Fang <fangwei1@huawei.com>

commit 816b0acf3deb6d6be5d0519b286fdd4bafade905 upstream.

If first_bad == this_sector when we get the WriteMostly disk
in read_balance(), valid disk will be returned with zero
max_sectors. It'll lead to a dead loop in make_request(), and
OOM will happen because of endless allocation of struct bio.

Since we can't get data from this disk in this case, so
continue for another disk.

Signed-off-by: Wei Fang <fangwei1@huawei.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/raid1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -563,7 +563,7 @@ static int read_balance(struct r1conf *c
 			if (best_dist_disk < 0) {
 				if (is_badblock(rdev, this_sector, sectors,
 						&first_bad, &bad_sectors)) {
-					if (first_bad < this_sector)
+					if (first_bad <= this_sector)
 						/* Cannot use this */
 						continue;
 					best_good_sectors = first_bad - this_sector;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web