On 29.01.2013 06:45, Ben Hutchings wrote:
I'm slightly uneasy about returning 0 for all writes to a read-only
deivce, because if someone ever fails to check the read-only flag
elsewhere this could turn into silent data loss. Does this work:
BUG_ON(bio_segments(bio));
Or should it be:
bio_endio(bio, bio_segments(bio) == 0 ? 0 : -EROFS);
to make the error survivable?
Good point. But it's better to use "bio_sectors" as bi_size is the
important information. I've seen that DRBD detects empty flushes the
same way.
For testing I've disabled the "set_disk_ro" in "md_set_readonly". Then,
I did direct IO writes on the read-only array and it worked - I've
received "Input/output error" in the user space.
I've attached version 4 of the patch.
Any further objection?