Files
linux/drivers
Josh Durgin 4e752f0ab0 rbd: access snapshot context and mapping size safely
These fields may both change while the image is mapped if a snapshot
is created or deleted or the image is resized.  They are guarded by
rbd_dev->header_rwsem, so hold that while reading them, and store a
local copy to refer to outside of the critical section. The local copy
will stay consistent since the snapshot context is reference counted,
and the mapping size is just a u64. This prevents torn loads from
giving us inconsistent values.

Move reading header.snapc into the caller of rbd_img_request_create()
so that we only need to take the semaphore once. The read-only caller,
rbd_parent_request_create() can just pass NULL for snapc, since the
snapshot context is only relevant for writes.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2014-10-14 21:03:27 +04:00
..
2014-09-09 13:52:18 -07:00
2014-08-05 21:16:46 -07:00
2014-08-15 17:06:40 -04:00
2014-10-01 16:46:34 -04:00
2014-09-25 11:55:50 +01:00
2014-07-30 00:23:09 +02:00
2014-08-25 15:39:22 -04:00
2014-09-08 16:33:56 -07:00