| Submitter | Luis Henriques |
|---|---|
| Date | March 14, 2013, 10:35 a.m. |
| Message ID | <1363257381-15900-52-git-send-email-luis.henriques@canonical.com> |
| Download | mbox | patch |
| Permalink | /patch/227593/ |
| State | New |
| Headers | show |
Comments
Patch
diff --git a/drivers/md/md.c b/drivers/md/md.c index 97edf9e..b7a551d 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -344,6 +344,10 @@ static void md_make_request(struct request_queue *q, struct bio *bio) bio_io_error(bio); return; } + if (mddev->ro == 1 && unlikely(rw == WRITE)) { + bio_endio(bio, bio_sectors(bio) == 0 ? 0 : -EROFS); + return; + } smp_rmb(); /* Ensure implications of 'active' are visible */ rcu_read_lock(); if (mddev->suspended) {