]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: use ->lock to protect accessing raid5 sysfs attributes.
authorNeilBrown <neilb@suse.de>
Mon, 15 Dec 2014 01:56:59 +0000 (12:56 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 5 Feb 2015 22:32:55 +0000 (09:32 +1100)
commit64795620ee536f1be7e3296c31e5477bcfab0fc5
tree7cb275a901ca30331d6c53be02be58bd578cb2b8
parentf0f722c1e9ad51f037e6b52bbb4fe1ae3df6f986
md/raid5: use ->lock to protect accessing raid5 sysfs attributes.

It is important that mddev->private isn't freed while
a sysfs attribute function is accessing it.

So use mddev->lock to protect the setting of ->private to NULL, and
take that lock when checking ->private for NULL and de-referencing it
in the sysfs access functions.

This only applies to the read ('show') side of access.  Write
access will be handled separately.

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