]> git.baikalelectronics.ru Git - kernel.git/commit
md/bitmap: don't abuse i_writecount for bitmap files.
authorNeilBrown <neilb@suse.de>
Wed, 9 Apr 2014 02:25:40 +0000 (12:25 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 9 Apr 2014 02:26:59 +0000 (12:26 +1000)
commitd64fa7889d74217b401b8441e8ad4828d9483ba4
treeea9f5c2d54e7e5397318ba9b91b0b88a33f179ae
parent7b9e7bfa1102114fdf61f36dd644d446412dac11
md/bitmap: don't abuse i_writecount for bitmap files.

md bitmap code currently tries to use i_writecount to stop any other
process from writing to out bitmap file.  But that is really an abuse
and has bit-rotted so locking is all wrong.

So discard that - root should be allowed to shoot self in foot.

Still use it in a much less intrusive way to stop the same file being
used as bitmap on two different array, and apply other checks to
ensure the file is at least vaguely usable for bitmap storage
(is regular, is open for write.  Support for ->bmap is already checked
elsewhere).

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/md.h