]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd discard return -EINVAL if len > MAX_INT32 20287/head
authorHuan Zhang <zhanghuan@chinac.com>
Fri, 24 Jun 2016 03:27:53 +0000 (11:27 +0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 3 Feb 2018 22:17:26 +0000 (23:17 +0100)
commit2003e6da3e2500a12d3dbd018cc7b8deba92d36b
tree24fdb597c0c5ae56760a4cde320cbd2207d7ac98
parent25189d5822c8c28cc23873a0969e5e77f572988d
rbd discard return -EINVAL if len > MAX_INT32

rbd discard use 'int' to return discarded length, but the 'len' user
passed is 'uint64', in some case, the ret value will be truncated
and return a negative value which means discard failed. ret -EINVAL
if len > MAX_INT32 to indicate support len <= MAX_INT32 only.

Fixes: http://tracker.ceph.com/issues/16465
Signed-off-by: Huan Zhang <zhanghuan@chinac.com>
(cherry picked from commit ec259dfde87ed9bc5e7247f311b629707c636895)
src/librbd/librbd.cc