diff options
author | 2014-04-08 11:12:11 -0700 | |
---|---|---|
committer | 2014-10-14 21:03:27 +0400 | |
commit | 4e752f0ab0e8114f4edd7574081dc625d679dd15 (patch) | |
tree | 80ef03b61b96c8eacf052607f28fcea03d5cce9f /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | rbd: do not return -ERANGE on auth failures (diff) | |
download | wireguard-linux-4e752f0ab0e8114f4edd7574081dc625d679dd15.tar.xz wireguard-linux-4e752f0ab0e8114f4edd7574081dc625d679dd15.zip |
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>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions