Skip to content
Commit 3c5df893 authored by Josh Durgin's avatar Josh Durgin Committed by Ilya Dryomov
Browse files

rbd: read image size for discard check safely



In rbd_img_request_fill() the image size is only checked to determine
whether we can truncate an object instead of zeroing it for discard
requests. Take rbd_dev->header_rwsem while reading the image size, and
move this read into the discard check, so that non-discard ops don't
need to take the semaphore in this function.

Signed-off-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 90e98c52
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment