ceph: adding protection for showing cap reservation info
authorChengguang Xu <cgxu519@icloud.com>
Fri, 23 Feb 2018 09:09:38 +0000 (17:09 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 2 Apr 2018 08:12:46 +0000 (10:12 +0200)
commitb884014a91a49ed0e7198d276b28887cc48363bd
tree5bef0732e3736d68dbb5c57f60bc532d3fe74d40
parentf2f87877b8f29a4aa0000a2e3cdf806ac645500e
ceph: adding protection for showing cap reservation info

Adding spinlock protection during getting cap reservation
ralated fields so that the numbers match below BUG_ON condition
in the code.

BUG_ON(mdsc->caps_total_count != mdsc->caps_use_count +
 mdsc->caps_reserve_count +
 mdsc->caps_avail_count);

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c