Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests] common/nvme: do not truncate FULL file at nvme disconnect
@ 2026-08-28  8:27 Shin'ichiro Kawasaki
  2026-09-03 12:57 ` Shin'ichiro Kawasaki
  0 siblings, 1 reply; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-08-28  8:27 UTC (permalink / raw)
  To: linux-nvme; +Cc: Daniel Wagner, Shin'ichiro Kawasaki

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@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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH blktests] common/nvme: do not truncate FULL file at nvme disconnect
  2026-08-28  8:27 [PATCH blktests] common/nvme: do not truncate FULL file at nvme disconnect Shin'ichiro Kawasaki
@ 2026-09-03 12:57 ` Shin'ichiro Kawasaki
  0 siblings, 0 replies; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-09-03 12:57 UTC (permalink / raw)
  To: linux-nvme; +Cc: Daniel Wagner

On Aug 28, 2026 / 17:27, Shin'ichiro Kawasaki wrote:
> 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@wdc.com>

FYI, I applied the patch.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-03 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  8:27 [PATCH blktests] common/nvme: do not truncate FULL file at nvme disconnect Shin'ichiro Kawasaki
2026-09-03 12:57 ` Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox