Skip to contentSkip to conversation

rbd: nuke the 32-bit pool id check

PATCH In review Ilya Dryomov 2 participants 3 messages Aug 9, 2016

Subsystems (2)
lore
Share & tools
lore

Ilya Dryomov

author maintainer
#0 lore raw

PATCH 1/1 rbd: nuke the 32-bit pool id check

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.

---
 drivers/block/rbd.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/block/rbd.c +0 -9
index 07668a6f0607..6c6519f6492a 100644
@@ -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;
Signature · 1 line
2.4.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ilya Dryomov

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.

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.

Quoted 25 lines
---
 drivers/block/rbd.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/block/rbd.c +0 -9
index 07668a6f0607..6c6519f6492a 100644
@@ -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;
author maintainer
#2 lore raw
Quoted 6 lines · Alex Elder
Quoted 4 lines · Ilya Dryomov

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.

Quoted 7 lines

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.

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

Thanks,

Ilya