]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nvme: fix counting available ports
authorJohannes Thumshirn <jthumshirn@suse.de>
Tue, 24 Apr 2018 16:12:49 +0000 (10:12 -0600)
committerOmar Sandoval <osandov@fb.com>
Wed, 25 Apr 2018 03:40:39 +0000 (20:40 -0700)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
common/nvme

index 400f66690f52a3db1862311a6cc5c81bcda0832f..506612f2729759dfe9c542537b580f0fa8acecc0 100644 (file)
@@ -29,7 +29,7 @@ _create_nvmet_port() {
        local trtype="$1"
        local nvmet_cfs="/sys/kernel/config/nvmet/"
 
-       local port=$(($(ls "${nvmet_cfs}" | wc -l) + 1))
+       local port=$(($(ls "${nvmet_cfs}/ports" | wc -l) + 1))
 
        mkdir "${nvmet_cfs}/ports/${port}"
        echo "${trtype}" > "${nvmet_cfs}/ports/${port}/addr_trtype"