Bug #3871
closed
krbd: initial header read may be out of date
Added by Josh Durgin over 11 years ago.
Updated about 11 years ago.
Description
Currently krbd uses the version parameter of a watch operation to try to prevent this, but that was never implemented, and would have problems with retries anyway. Instead, we can fix the race by establishing a watch before reading the header, so we won't miss any notifies between reading the header and establishing a watch. This race could make a snapshot not actually be created as intended, since the snapshot context would be out of date.
This was fixed recently in userspace by commit:c4370ff03f8ab655a009cfd9ba3a0827d8c58b11
- Project changed from rbd to Linux kernel client
- Project changed from Linux kernel client to rbd
- Status changed from 12 to In Progress
- Assignee set to Alex Elder
- Status changed from In Progress to 12
- Status changed from 12 to Fix Under Review
The following have been posted for review. They are available
in the "review/wip-rbd-cleanup-4" in the ceph-client git
repository, which is based on branch "review/wip-rbd-cleanup-3".
This series ends with a patch that avoids a race involving the
initial read of an rbd image header and a change to the snapshot
context. The problem occurs because the rbd client sets up its
watch request on the header object after the initial header
read, and if the snapshot context changes between them the
kernel client snapshot context will not be up-to-date.
The fix is to set up the watch before doing the initial
header read. The recent patches, along with the patches
in this series, make doing things in this order possible.
-Alex
[PATCH 1/5] rbd: move more initialization into rbd_dev_probe_image()
[PATCH 2/5] rbd: define rbd_header_name()
[PATCH 3/5] rbd: don't clean up watch in device release function
[PATCH 4/5] rbd: don't bother checking whether order changes
[PATCH 5/5] rbd: set up watch in rbd_dev_probe_image()
- Status changed from Fix Under Review to Resolved
I guess I neglected to mark this resolved.
The following was committed to the "testing" branch
of the ceph-client git repository.
b644de2 rbd: set up watch in rbd_dev_image_probe()
96f03e0 rbd: don't bother checking whether order changes
0d8189e rbd: don't clean up watch in device release function
332bb12 rbd: define rbd_header_name()
9bb81c9 rbd: move more initialization into rbd_dev_image_probe()
Also available in: Atom
PDF