diff mbox

rbd: nuke the 32-bit pool id check

Message ID 1470753737-5729-1-git-send-email-idryomov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ilya Dryomov Aug. 9, 2016, 2:42 p.m. UTC
ceph_file_layout::pool_id is now s64.  rbd_add_get_pool_id() and
ceph_pg_poolid_by_name() both return an int, so it's bogus anyway.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
 drivers/block/rbd.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Alex Elder Aug. 9, 2016, 2:45 p.m. UTC | #1
On 08/09/2016 09:42 AM, Ilya Dryomov wrote:
> ceph_file_layout::pool_id is now s64.  rbd_add_get_pool_id() and
> ceph_pg_poolid_by_name() both return an int, so it's bogus anyway.
> 
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

If a pool id is really 64 bits (signed), shouldn't
rbd_add_get_pool_id() and ceph_pg_poolid_by_name()
be changed to return that type (first)?

This otherwise looks good.

Reviewed-by: Alex Elder <elder@linaro.org>

> ---
>  drivers/block/rbd.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 07668a6f0607..6c6519f6492a 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5337,15 +5337,6 @@ static ssize_t do_rbd_add(struct bus_type *bus,
>  	}
>  	spec->pool_id = (u64)rc;
>  
> -	/* The ceph file layout needs to fit pool id in 32 bits */
> -
> -	if (spec->pool_id > (u64)U32_MAX) {
> -		rbd_warn(NULL, "pool id too large (%llu > %u)",
> -				(unsigned long long)spec->pool_id, U32_MAX);
> -		rc = -EIO;
> -		goto err_out_client;
> -	}
> -
>  	rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts);
>  	if (!rbd_dev) {
>  		rc = -ENOMEM;
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ilya Dryomov Aug. 9, 2016, 2:51 p.m. UTC | #2
On Tue, Aug 9, 2016 at 4:45 PM, Alex Elder <elder@ieee.org> wrote:
> On 08/09/2016 09:42 AM, Ilya Dryomov wrote:
>> ceph_file_layout::pool_id is now s64.  rbd_add_get_pool_id() and
>> ceph_pg_poolid_by_name() both return an int, so it's bogus anyway.
>>
>> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
>
> If a pool id is really 64 bits (signed), shouldn't
> rbd_add_get_pool_id() and ceph_pg_poolid_by_name()
> be changed to return that type (first)?
>
> This otherwise looks good.
>
> Reviewed-by: Alex Elder <elder@linaro.org>

Yeah, they should, along with s64/u64 inconsistencies...

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 07668a6f0607..6c6519f6492a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5337,15 +5337,6 @@  static ssize_t do_rbd_add(struct bus_type *bus,
 	}
 	spec->pool_id = (u64)rc;
 
-	/* The ceph file layout needs to fit pool id in 32 bits */
-
-	if (spec->pool_id > (u64)U32_MAX) {
-		rbd_warn(NULL, "pool id too large (%llu > %u)",
-				(unsigned long long)spec->pool_id, U32_MAX);
-		rc = -EIO;
-		goto err_out_client;
-	}
-
 	rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts);
 	if (!rbd_dev) {
 		rc = -ENOMEM;