diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-03 22:54:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-03 22:54:57 -0500 |
commit | 59acf65776f8720d5f7c4efec545d1ecec6abca3 (patch) | |
tree | 2295970b51277beb8b6e8e2024dfbd45ba2e9d9c | |
parent | 0f98c38d725f88d6452af46eed96a3a6791b230a (diff) | |
parent | d95901433436aeb921eac58bfd8a2aa77f110384 (diff) |
Merge tag 'md/3.19-fixes' of git://neil.brown.name/md
Pull two fixes for md from Neil Brown:
- Another live lock, needs backporting
- work-around false positive with new warnings.
* tag 'md/3.19-fixes' of git://neil.brown.name/md:
md/bitmap: fix a might_sleep() warning.
md/raid5: fix another livelock caused by non-aligned writes.
-rw-r--r-- | drivers/md/bitmap.c | 13 | ||||
-rw-r--r-- | drivers/md/raid5.c | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index da3604e73e8a..1695ee5f3ffc 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -72,6 +72,19 @@ __acquires(bitmap->lock) | |||
72 | /* this page has not been allocated yet */ | 72 | /* this page has not been allocated yet */ |
73 | 73 | ||
74 | spin_unlock_irq(&bitmap->lock); | 74 | spin_unlock_irq(&bitmap->lock); |
75 | /* It is possible that this is being called inside a | ||
76 | * prepare_to_wait/finish_wait loop from raid5c:make_request(). | ||
77 | * In general it is not permitted to sleep in that context as it | ||
78 | * can cause the loop to spin freely. | ||
79 | * That doesn't apply here as we can only reach this point | ||
80 | * once with any loop. | ||
81 | * When this function completes, either bp[page].map or | ||
82 | * bp[page].hijacked. In either case, this function will | ||
83 | * abort before getting to this point again. So there is | ||
84 | * no risk of a free-spin, and so it is safe to assert | ||
85 | * that sleeping here is allowed. | ||
86 | */ | ||
87 | sched_annotate_sleep(); | ||
75 | mappage = kzalloc(PAGE_SIZE, GFP_NOIO); | 88 | mappage = kzalloc(PAGE_SIZE, GFP_NOIO); |
76 | spin_lock_irq(&bitmap->lock); | 89 | spin_lock_irq(&bitmap->lock); |
77 | 90 | ||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c1b0d52bfcb0..b98765f6f77f 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3195,6 +3195,11 @@ static void handle_stripe_dirtying(struct r5conf *conf, | |||
3195 | (unsigned long long)sh->sector, | 3195 | (unsigned long long)sh->sector, |
3196 | rcw, qread, test_bit(STRIPE_DELAYED, &sh->state)); | 3196 | rcw, qread, test_bit(STRIPE_DELAYED, &sh->state)); |
3197 | } | 3197 | } |
3198 | |||
3199 | if (rcw > disks && rmw > disks && | ||
3200 | !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | ||
3201 | set_bit(STRIPE_DELAYED, &sh->state); | ||
3202 | |||
3198 | /* now if nothing is locked, and if we have enough data, | 3203 | /* now if nothing is locked, and if we have enough data, |
3199 | * we can start a write request | 3204 | * we can start a write request |
3200 | */ | 3205 | */ |