[PATCH blktests] common/nvme: do not truncate FULL file at nvme disconnect

Shin'ichiro Kawasaki shinichiro.kawasaki at wdc.com
Fri Aug 28 01:27:21 PDT 2026


Commit df7cf50409ce ("nvme: rely on nvme-cli status code") reworked the
nvme-cli command error handling. As part of that change, the 'nvme
disconnect' commands in _nvme_disconnect_ctrl() and
_nvme_disconnect_subsys() were made to record their output in the FULL
file using the '&>' redirect operator. However, '&>' truncates the file
and so overwrites its existing content, wiping out the logs that each
test case had already left in the FULL file.

Use the '&>>' operator instead, which appends the command output while
preserving the existing FULL file content.

Fixes: df7cf50409ce ("nvme: rely on nvme-cli status code")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
---
 common/nvme | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/nvme b/common/nvme
index f399937..a11401c 100644
--- a/common/nvme
+++ b/common/nvme
@@ -354,7 +354,7 @@ _nvme_disconnect_ctrl() {
 	if [[ -d "${ctrl_dir}" ]]; then
 		local ret
 
-		nvme disconnect --device "${ctrl}" &> "${FULL}"
+		nvme disconnect --device "${ctrl}" &>> "${FULL}"
 		ret=$?
 		if [[ ${ret} -ne 0 ]]; then
 			echo "FAIL: nvme disconnect returned error code: ${ret}"
@@ -638,7 +638,7 @@ _nvme_disconnect_subsys() {
 		esac
 	done
 
-	nvme disconnect --nqn "${subsysnqn}" &> "${FULL}"
+	nvme disconnect --nqn "${subsysnqn}" &>> "${FULL}"
 	ret=$?
 	if [[ ${ret} -ne 0 ]]; then
 		echo "FAIL: nvme disconnect returned error code: ${ret}"
-- 
2.54.0




More information about the Linux-nvme mailing list