Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176082
b: refs/heads/master
c: 6eef4b2
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Dec 14, 2009
1 parent 85eeff8 commit 88ae260
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 729a18663a30a9c8076e3adc2b3e4c866974f935
refs/heads/master: 6eef4b21ffc9207b78fdd718154f5b004644b97d
22 changes: 22 additions & 0 deletions trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,25 @@ static int make_request(struct request_queue *q, struct bio * bio)

md_write_start(mddev, bio); /* wait on superblock update early */

if (bio_data_dir(bio) == WRITE &&
bio->bi_sector + bio->bi_size/512 > mddev->suspend_lo &&
bio->bi_sector < mddev->suspend_hi) {
/* As the suspend_* range is controlled by
* userspace, we want an interruptible
* wait.
*/
DEFINE_WAIT(w);
for (;;) {
flush_signals(current);
prepare_to_wait(&conf->wait_barrier,
&w, TASK_INTERRUPTIBLE);
if (bio->bi_sector + bio->bi_size/512 <= mddev->suspend_lo ||
bio->bi_sector >= mddev->suspend_hi)
break;
schedule();
}
finish_wait(&conf->wait_barrier, &w);
}
if (unlikely(!mddev->barriers_work &&
bio_rw_flagged(bio, BIO_RW_BARRIER))) {
if (rw == WRITE)
Expand Down Expand Up @@ -2271,6 +2290,9 @@ static void raid1_quiesce(mddev_t *mddev, int state)
conf_t *conf = mddev->private;

switch(state) {
case 2: /* wake for suspend */
wake_up(&conf->wait_barrier);
break;
case 1:
raise_barrier(conf);
break;
Expand Down

0 comments on commit 88ae260

Please sign in to comment.