Fine, I tried latest SPDK in branch master and the issue don't occured. Maybe you can reproduce this issue in v18.04.1 Thanks. > -----原始邮件----- > 发件人: "Liu, Changpeng" > 发送时间: 2018-07-27 16:57:47 (星期五) > 收件人: "Storage Performance Development Kit" > 抄送: > 主题: Re: [SPDK] The size of lvol_bdev is smaller than expected > > Hi Zhouhui, > > I tried your parameters and the code looks good to me. > > Please see attached results from my test server. I also used 4TiB P4500. > > { > "num_blocks": 975799296, > "uuid": "fa72086a-8f74-45f1-ab0d-8a4d805ba0ea", > "aliases": [ > "lvs_0/lbd_0" > ], > "claimed": false, > "driver_specific": { > "lvol": { > "base_bdev": "Nvme0n1", > "clone": false, > "snapshot": false, > "lvol_store_uuid": "37c1d411-a1f0-4483-b14d-a7bdea264a28", > "thin_provision": false > } > }, > "supported_io_types": { > "reset": true, > "nvme_admin": false, > "unmap": true, > "read": true, > "write_zeroes": true, > "write": true, > "flush": false, > "nvme_io": false > }, > "qos_ios_per_sec": 0, > "block_size": 4096, > "product_name": "Logical Volume", > "name": "fa72086a-8f74-45f1-ab0d-8a4d805ba0ea" > } > > > -----Original Message----- > > From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of wuzhouhui > > Sent: Friday, July 27, 2018 4:07 PM > > To: spdk(a)lists.01.org > > Subject: [SPDK] The size of lvol_bdev is smaller than expected > > > > I using all clusters of lvol_store to create a single lvol_bdev, > > but the size is smaller than expected. The expected size should > > be 3.7 TB, but 1.7 TB in reality. Following is my procedure: > > 1. Start vhost app: > > ./app/vhost -m 0x3 -S /var/tmp > > 2. Create nvme_bdev: > > ./rpc.py construct_nvme_bdev -b nvme0 -t pcie -a "0000:31:00.0" > > The 0000:31:00.0 is the Intel SSD DC P4500, 3.7 TB in total. > > 3. Create lvol_store: > > ./rpc.py construct_lvol_store nvme0n1 lvs0 > > After created, the total free cluster is 952929: > > ./rpc.py get_lvol_stores > > [ > > { > > "uuid": "88d3072e-a0e6-4020-9bdd-cd0fd300ec23", > > "base_bdev": "nvme0n1", > > "free_clusters": 952929, > > "cluster_size": 4194304, > > "total_data_clusters": 952929, > > "block_size": 4096, > > "name": "lvs0" > > } > > ] > > 4. I use all free clusters of lvs0 to create a single lvol_bdev: > > ./rpc.py construct_lvol_bdev -l lvs0 lv0 3811716 > > The value "3811716" is comming from "952929 * 4" > > 5. Check the size of lvs0/lv0: > > ./rpc.py get_bdevs > > Accoring to the lvs0/lv0's "num_blocks" and "block_size", the size of > > lvs0/lv0 is 1.7 TB, not 3.7 TB. > > 6. After I delete lvs0/lv0: > > ./rpc.py destroy_lvol_bdev lvs0/lv0 > > There is still some clusters not freed, but there is no other lvol_bdevs > > exists: > > ./rpc.py get_lvol_stores > > [ > > { > > "uuid": "88d3072e-a0e6-4020-9bdd-cd0fd300ec23", > > "base_bdev": "nvme0n1", > > "free_clusters": 428641, > > "cluster_size": 4194304, > > "total_data_clusters": 952929, > > "block_size": 4096, > > "name": "lvs0" > > } > > ] > > > > SPDK version: 18.04.1 > > OS: CentSO 7.4 > > SSD: Intel SSD DC P4500 > > > > Is this a bug? > > _______________________________________________ > > SPDK mailing list > > SPDK(a)lists.01.org > > https://lists.01.org/mailman/listinfo/spdk > _______________________________________________ > SPDK mailing list > SPDK(a)lists.01.org > https://lists.01.org/mailman/listinfo/spdk