summaryrefslogtreecommitdiff
path: root/include/linux/miscdevice.h
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2026-01-07 22:37:55 +0100
committerIlya Dryomov <idryomov@gmail.com>2026-02-03 21:00:22 +0100
commitbd3884a204c3b507e6baa9a4091aa927f9af5404 (patch)
tree874ddca9685bde4c35d59695a4a4a614fd5fd4ac /include/linux/miscdevice.h
parent18f7fcd5e69a04df57b563360b88be72471d6b62 (diff)
rbd: check for EOD after exclusive lock is ensured to be held
Similar to commit 870611e4877e ("rbd: get snapshot context after exclusive lock is ensured to be held"), move the "beyond EOD" check into the image request state machine so that it's performed after exclusive lock is ensured to be held. This avoids various race conditions which can arise when the image is shrunk under I/O (in practice, mostly readahead). In one such scenario rbd_assert(objno < rbd_dev->object_map_size); can be triggered if a close-to-EOD read gets queued right before the shrink is initiated and the EOD check is performed against an outdated mapping_size. After the resize is done on the server side and exclusive lock is (re)acquired bringing along the new (now shrunk) object map, the read starts going through the state machine and rbd_obj_may_exist() gets invoked on an object that is out of bounds of rbd_dev->object_map array. Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Dongsheng Yang <dongsheng.yang@linux.dev>
Diffstat (limited to 'include/linux/miscdevice.h')
0 files changed, 0 insertions, 0 deletions