]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: protect against crash upon fsync on ro array
authorSebastian Riemer <sebastian.riemer@profitbricks.com>
Fri, 25 Jan 2013 11:46:59 +0000 (12:46 +0100)
committerNeilBrown <neilb@suse.de>
Mon, 4 Feb 2013 21:35:02 +0000 (08:35 +1100)
commit0ecfa11f08c79be05eb00bba537e764e6672774d
tree46feac7bfc8ac7e4fb90e742c201ad0686d4e373
parent55ebbb59c1c6eb1b040f62b8c4ae0b724de6e55a
md: protect against crash upon fsync on ro array

If an fsync occurs 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.

By advice of Christoph Hellwig we return success upon a flush
request but we return -EROFS for other writes.
We detect flush requests by checking if the bio has zero sectors.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: NeilBrown <neilb@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c