From: Josh Durgin Date: Fri, 4 Apr 2014 19:06:32 +0000 (-0700) Subject: rbd: read image size for discard check safely X-Git-Tag: fixes-against-v3.18-rc2~71^2~24 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c5df89367761d09d76454a2c4301a73bf2d46ce;p=pandora-kernel.git 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: Josh Durgin --- Reading git-diff-tree failed