diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-06-02 10:58:54 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-06-02 10:58:54 -0400 |
commit | b8f93849eaeba2ce54b6bf769ab6298a1891f17c (patch) | |
tree | 7a1f4c42928cd323e0f6b1e343582826df2810e8 | |
parent | cbc211cc95a2329bdf39e10ec0144806a572319b (diff) | |
download | longterm-queue-4.8-b8f93849eaeba2ce54b6bf769ab6298a1891f17c.tar.gz |
raid: drop patch not applicable to 4.8.x
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/md-raid1-10-fix-potential-deadlock.patch | 126 | ||||
-rw-r--r-- | queue/series | 1 |
2 files changed, 0 insertions, 127 deletions
diff --git a/queue/md-raid1-10-fix-potential-deadlock.patch b/queue/md-raid1-10-fix-potential-deadlock.patch deleted file mode 100644 index 678e00f..0000000 --- a/queue/md-raid1-10-fix-potential-deadlock.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 61eb2b43b99ebdc9bc6bc83d9792257b243e7cb3 Mon Sep 17 00:00:00 2001 -From: Shaohua Li <shli@fb.com> -Date: Tue, 28 Feb 2017 13:00:20 -0800 -Subject: [PATCH] md/raid1/10: fix potential deadlock - -commit 61eb2b43b99ebdc9bc6bc83d9792257b243e7cb3 upstream. - -Neil Brown pointed out a potential deadlock in raid 10 code with -bio_split/chain. The raid1 code could have the same issue, but recent -barrier rework makes it less likely to happen. The deadlock happens in -below sequence: - -1. generic_make_request(bio), this will set current->bio_list -2. raid10_make_request will split bio to bio1 and bio2 -3. __make_request(bio1), wait_barrer, add underlayer disk bio to -current->bio_list -4. __make_request(bio2), wait_barrer - -If raise_barrier happens between 3 & 4, since wait_barrier runs at 3, -raise_barrier waits for IO completion from 3. And since raise_barrier -sets barrier, 4 waits for raise_barrier. But IO from 3 can't be -dispatched because raid10_make_request() doesn't finished yet. - -The solution is to adjust the IO ordering. Quotes from Neil: -" -It is much safer to: - - if (need to split) { - split = bio_split(bio, ...) - bio_chain(...) - make_request_fn(split); - generic_make_request(bio); - } else - make_request_fn(mddev, bio); - -This way we first process the initial section of the bio (in 'split') -which will queue some requests to the underlying devices. These -requests will be queued in generic_make_request. -Then we queue the remainder of the bio, which will be added to the end -of the generic_make_request queue. -Then we return. -generic_make_request() will pop the lower-level device requests off the -queue and handle them first. Then it will process the remainder -of the original bio once the first section has been fully processed. -" - -Note, this only happens in read path. In write path, the bio is flushed to -underlaying disks either by blk flush (from schedule) or offladed to raid1/10d. -It's queued in current->bio_list. - -Cc: Coly Li <colyli@suse.de> -Cc: stable@vger.kernel.org (v3.14+, only the raid10 part) -Suggested-by: NeilBrown <neilb@suse.com> -Reviewed-by: Jack Wang <jinpu.wang@profitbricks.com> -Signed-off-by: Shaohua Li <shli@fb.com> - -diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c -index 10c3865e1186..c33e96e33b8e 100644 ---- a/drivers/md/raid1.c -+++ b/drivers/md/raid1.c -@@ -1587,9 +1587,30 @@ static void raid1_make_request(struct mddev *mddev, struct bio *bio) - split = bio; - } - -- if (bio_data_dir(split) == READ) -+ if (bio_data_dir(split) == READ) { - raid1_read_request(mddev, split); -- else -+ -+ /* -+ * If a bio is splitted, the first part of bio will -+ * pass barrier but the bio is queued in -+ * current->bio_list (see generic_make_request). If -+ * there is a raise_barrier() called here, the second -+ * part of bio can't pass barrier. But since the first -+ * part bio isn't dispatched to underlaying disks yet, -+ * the barrier is never released, hence raise_barrier -+ * will alays wait. We have a deadlock. -+ * Note, this only happens in read path. For write -+ * path, the first part of bio is dispatched in a -+ * schedule() call (because of blk plug) or offloaded -+ * to raid10d. -+ * Quitting from the function immediately can change -+ * the bio order queued in bio_list and avoid the deadlock. -+ */ -+ if (split != bio) { -+ generic_make_request(bio); -+ break; -+ } -+ } else - raid1_write_request(mddev, split); - } while (split != bio); - } -diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c -index c4db6d1fb6a2..b1b1f982a722 100644 ---- a/drivers/md/raid10.c -+++ b/drivers/md/raid10.c -@@ -1584,7 +1584,25 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio) - split = bio; - } - -+ /* -+ * If a bio is splitted, the first part of bio will pass -+ * barrier but the bio is queued in current->bio_list (see -+ * generic_make_request). If there is a raise_barrier() called -+ * here, the second part of bio can't pass barrier. But since -+ * the first part bio isn't dispatched to underlaying disks -+ * yet, the barrier is never released, hence raise_barrier will -+ * alays wait. We have a deadlock. -+ * Note, this only happens in read path. For write path, the -+ * first part of bio is dispatched in a schedule() call -+ * (because of blk plug) or offloaded to raid10d. -+ * Quitting from the function immediately can change the bio -+ * order queued in bio_list and avoid the deadlock. -+ */ - __make_request(mddev, split); -+ if (split != bio && bio_data_dir(bio) == READ) { -+ generic_make_request(bio); -+ break; -+ } - } while (split != bio); - - /* In case raid10d snuck in to freeze_array */ --- -2.12.0 - diff --git a/queue/series b/queue/series index 3f7dfb7..5710a4c 100644 --- a/queue/series +++ b/queue/series @@ -9,7 +9,6 @@ perf-core-Fix-use-after-free-in-perf_release.patch perf-core-Fix-event-inheritance-on-fork.patch cpufreq-Fix-and-clean-up-show_cpuinfo_cur_freq.patch powerpc-boot-Fix-zImage-TOC-alignment.patch -md-raid1-10-fix-potential-deadlock.patch target-pscsi-Fix-TYPE_TAPE-TYPE_MEDIMUM_CHANGER-expo.patch scsi-lpfc-Add-shutdown-method-for-kexec.patch scsi-libiscsi-add-lock-around-task-lists-to-fix-list.patch |