md: protect against crash upon fsync on ro array (Closes: #696650)
svn path=/dists/sid/linux/; revision=19777
This commit is contained in:
parent
82605cce77
commit
08517ae9bd
|
@ -99,6 +99,7 @@ linux (3.2.37-1) UNRELEASED; urgency=low
|
|||
- rewrite punch hole to use ext4_ext_remove_space()
|
||||
- fix hole punch failure when depth is greater than 0
|
||||
- fix kernel BUG on large-scale rm -rf commands
|
||||
* md: protect against crash upon fsync on ro array (Closes: #696650)
|
||||
|
||||
[ Aurelien Jarno ]
|
||||
* [armhf/vexpress] Add kernel udebs.
|
||||
|
|
35
debian/patches/bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
vendored
Normal file
35
debian/patches/bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
From: Sebastian Riemer <sebastian.riemer@profitbricks.com>
|
||||
Date: Fri, 25 Jan 2013 12:46:59 +0100
|
||||
Subject: [PATCH] md: protect against crash upon fsync on ro array
|
||||
Bug-Debian: http://bugs.debian.org/696650
|
||||
|
||||
If an fsync occurrs on a read-only array, we need to send a
|
||||
completion for the IO and may not increment the active IO count.
|
||||
Otherwise, we hit a bug trace and can't stop the MD array anymore.
|
||||
|
||||
As return value -EROFS makes most sense.
|
||||
|
||||
Signed-off-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
|
||||
---
|
||||
drivers/md/md.c | 5 +++++
|
||||
1 files changed, 5 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/md/md.c b/drivers/md/md.c
|
||||
index 3db3d1b..475e0be 100644
|
||||
--- a/drivers/md/md.c
|
||||
+++ b/drivers/md/md.c
|
||||
@@ -322,6 +322,11 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
|
||||
}
|
||||
finish_wait(&mddev->sb_wait, &__wait);
|
||||
}
|
||||
+ if (mddev->ro == 1 && unlikely(rw == WRITE)) {
|
||||
+ rcu_read_unlock();
|
||||
+ bio_endio(bio, -EROFS);
|
||||
+ return;
|
||||
+ }
|
||||
atomic_inc(&mddev->active_io);
|
||||
rcu_read_unlock();
|
||||
|
||||
--
|
||||
1.7.1
|
||||
|
|
@ -471,3 +471,4 @@ bugfix/all/bridge-Pull-ip-header-into-skb-data-before-looking-i.patch
|
|||
bugfix/all/ext4-rewrite-punch-hole-to-use-ext4_ext_remove_space.patch
|
||||
bugfix/all/ext4-fix-hole-punch-failure-when-depth-is-greater-th.patch
|
||||
bugfix/all/ext4-fix-kernel-BUG-on-large-scale-rm-rf-commands.patch
|
||||
bugfix/all/md-protect-against-crash-upon-fsync-on-ro-array.patch
|
||||
|
|
Loading…
Reference in New Issue