summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@redhat.com>2015-01-19 18:13:43 +0300
committerJiri Slaby <jslaby@suse.cz>2015-02-08 20:02:07 +0100
commit926e01a576ca7630f4f52fa03127fb3276ac7e3e (patch)
treea832952f7db5b7a41720d186972fa8d1d9e4d7a3 /kernel/workqueue.c
parented64a543fa0eb24125468b3c845b7cc05c848b34 (diff)
downloadlwn-926e01a576ca7630f4f52fa03127fb3276ac7e3e.tar.gz
lwn-926e01a576ca7630f4f52fa03127fb3276ac7e3e.zip
rbd: fix rbd_dev_parent_get() when parent_overlap == 0
commit ae43e9d05eb4bd324155292f889fbd001c4faea8 upstream. The comment for rbd_dev_parent_get() said * We must get the reference before checking for the overlap to * coordinate properly with zeroing the parent overlap in * rbd_dev_v2_parent_info() when an image gets flattened. We * drop it again if there is no overlap. but the "drop it again if there is no overlap" part was missing from the implementation. This lead to absurd parent_ref values for images with parent_overlap == 0, as parent_ref was incremented for each img_request and virtually never decremented. Fix this by leveraging the fact that refresh path calls rbd_dev_v2_parent_info() under header_rwsem and use it for read in rbd_dev_parent_get(), instead of messing around with atomics. Get rid of barriers in rbd_dev_v2_parent_info() while at it - I don't see what they'd pair with now and I suspect we are in a pretty miserable situation as far as proper locking goes regardless. Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Josh Durgin <jdurgin@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org> [idryomov@redhat.com: backport to 3.14: context] Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'kernel/workqueue.c')
0 files changed, 0 insertions, 0 deletions