diff --git a/doc/lvol.md b/doc/lvol.md index 8d5f8707e..2e92bb949 100644 --- a/doc/lvol.md +++ b/doc/lvol.md @@ -24,7 +24,7 @@ A logical volume is implemented as an SPDK blob created from an lvolstore. An lv * Type name: struct spdk_lvol_bdev Representation of an SPDK block device (spdk_bdev) with an lvol implementation. -A logical volume block device translates generic SPDK block device I/O (spdk_bdev_io) operations into the equivalent SPDK blob operations. Combination of lvol ID and lvolstore UUID gives lvol_bdev name in a form "uuid/lvolid". block_size of the created bdev is always 4096, due to blobstore page size. Cluster_size is configurable by parameter. By default it is 1GiB. +A logical volume block device translates generic SPDK block device I/O (spdk_bdev_io) operations into the equivalent SPDK blob operations. Combination of lvol ID and lvolstore UUID gives lvol_bdev name in a form "uuid/lvolid". block_size of the created bdev is always 4096, due to blobstore page size. Cluster_size is configurable by parameter. Size of the new bdev will be rounded up to nearest multiple of cluster_size. By default lvol bdevs claim part of lvol store equal to their set size. When thin provision option is enabled, no space is taken from lvol store until data is written to lvol bdev. @@ -44,7 +44,7 @@ construct_lvol_store [-h] [-c CLUSTER_SZ] base_name Returns uuid of created lvolstore. Optional paramters: -h show help - -c CLUSTER_SZ Specifies the size of cluster. By default its 1GB. + -c CLUSTER_SZ Specifies the size of cluster. By default its 4MiB. destroy_lvol_store [-h] uuid Destroy lvolstore on specified bdev. Removes lvolstore along with lvols on it. Note that destroying lvolstore requires using this call, while deleting diff --git a/include/spdk_internal/lvolstore.h b/include/spdk_internal/lvolstore.h index b1189f6a4..bcbd2e3c5 100644 --- a/include/spdk_internal/lvolstore.h +++ b/include/spdk_internal/lvolstore.h @@ -41,7 +41,7 @@ #include /* Default size of blobstore cluster */ -#define SPDK_LVS_OPTS_CLUSTER_SZ (1024 * 1024 * 1024) +#define SPDK_LVS_OPTS_CLUSTER_SZ (4 * 1024 * 1024) /* Length of string returned from uuid_unparse() */ #define UUID_STRING_LEN 37 diff --git a/test/lvol/test_cases.py b/test/lvol/test_cases.py index 4f0272116..22bdd6935 100644 --- a/test/lvol/test_cases.py +++ b/test/lvol/test_cases.py @@ -666,7 +666,8 @@ class TestCases(object): def test_case601(self): header(601) fail_count = 0 - base_name = self.c.construct_malloc_bdev(self.total_size, + # Create malloc bdev smaller than default lvol cluster size + base_name = self.c.construct_malloc_bdev(1, self.block_size) if self.c.construct_lvol_store(base_name, self.lvs_name, 0) == 0: diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index 1fdeba791..ed130b162 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -131,7 +131,7 @@ for (( i=0; i<$max_disks; i++ ));do # Create base lvol store on NVMe notice "Creating lvol store on device Nvme${i}n1" - ls_guid=$($rpc_py construct_lvol_store Nvme${i}n1 lvs_$i) + ls_guid=$($rpc_py construct_lvol_store Nvme${i}n1 lvs_$i -c 4194304) lvol_stores+=("$ls_guid") if $nested_lvol; then @@ -142,7 +142,7 @@ for (( i=0; i<$max_disks; i++ ));do lb_name=$($rpc_py construct_lvol_bdev -u $ls_guid lbd_nest $size) notice "Creating nested lvol store on lvol bdev: $lb_name" - nest_ls_guid=$($rpc_py construct_lvol_store $lb_name lvs_n_$i) + nest_ls_guid=$($rpc_py construct_lvol_store $lb_name lvs_n_$i -c 4194304) nest_lvol_stores+=("$nest_ls_guid") for (( j=0; j<$vm_count; j++)); do