[LTP] [PATCH 1/2] tst_device: Print info about acquiring device

Petr Vorel pvorel@suse.cz
Mon May 27 22:28:57 CEST 2024


Print how much space is being acquired. Also print hint on ENOSPC.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/tst_device.c b/lib/tst_device.c
index d659b54cf..635b39d08 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -289,8 +289,10 @@ const char *tst_acquire_loop_device(unsigned int size, const char *filename)
 {
 	unsigned int acq_dev_size = size ? size : DEV_SIZE_MB;
 
+	tst_resm(TINFO, "Acquiring loop device %u MB", acq_dev_size);
 	if (tst_prealloc_file(filename, 1024 * 1024, acq_dev_size)) {
-		tst_resm(TWARN | TERRNO, "Failed to create %s", filename);
+		tst_resm(TWARN | TERRNO, "Failed to create %s%s", filename,
+			 errno == ENOSPC ? " (not enough space in $TMPDIR?)" : "");
 		return NULL;
 	}
 
-- 
2.43.0



More information about the ltp mailing list