]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: verify rbd image order value
authorAlex Elder <elder@inktank.com>
Sun, 21 Oct 2012 03:17:27 +0000 (22:17 -0500)
committerAlex Elder <elder@inktank.com>
Fri, 26 Oct 2012 22:18:08 +0000 (17:18 -0500)
commitfca06a0c902f43e4b86ab13c510319e0b3634cbb
treed73ade991884c9d60a04cb3953e632964ac20fce
parent981e684cd5b79265465b34dd606952bf8b21e1e2
rbd: verify rbd image order value

This adds a verification that an rbd image's object order is
within the upper and lower bounds supported by this implementation.

It must be at least 9 (SECTOR_SHIFT), because the Linux bio system
assumes that minimum granularity.

It also must be less than 32 (at the moment anyway) because there
exist spots in the code that store the size of a "segment" (object
backing an rbd image) in a signed int variable, which can be 32 bits
including the sign.  We should be able to relax this limit once
we've verified the code uses 64-bit types where needed.

Note that the CLI tool already limits the order to the range 12-25.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c