]> git.baikalelectronics.ru Git - kernel.git/commit
md/lock: ensure updates to page_attrs are properly locked.
authorNeilBrown <neilb@suse.de>
Tue, 22 Nov 2011 23:18:52 +0000 (10:18 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 22 Nov 2011 23:18:52 +0000 (10:18 +1100)
commit0839bb8bdad4f66e8e65465ca0d6b90f42d0611d
tree2c76f387184ac0cc587e66519536fc83e0f79553
parentbb0ed60825a95595d8fde41c5a81c0ae7857ef6a
md/lock: ensure updates to page_attrs are properly locked.

Page attributes are set using __set_bit rather than set_bit as
it normally called under a spinlock so the extra atomicity is not
needed.

However there are two places where we might set or clear page
attributes without holding the spinlock.
So add the spinlock in those cases.

This might be the cause of occasional reports that bits a aren't
getting clear properly - theory is that BITMAP_PAGE_PENDING gets lost
when BITMAP_PAGE_NEEDWRITE is set or cleared.  This is an
inconvenience, not a threat to data safety.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c