]> 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)
commit6dbff5f21916e0f4afa8458749ace19d4cdce15e
treeea9f5c2d54e7e5397318ba9b91b0b88a33f179ae
parent837ca78edf52818164c21c170b79badb0e52548b
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