[LTP] [PATCH 2/3] syscalls/preadv203: don't treat short write() as failure

Jan Stancek jstancek@redhat.com
Mon Oct 3 14:48:47 CEST 2022


Test is sporadically running into TBROK in setup() due to short write:
  tst_test.c:1064: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
  preadv203.c:257: TBROK: write(501,0x3fff4ef7d15,4123) failed: SUCCESS (0)

Switch to SAFE_WRITE_FULLY().

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/preadv2/preadv203.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/preadv2/preadv203.c b/testcases/kernel/syscalls/preadv2/preadv203.c
index 60dc4a882f16..f3e3ef438de2 100644
--- a/testcases/kernel/syscalls/preadv2/preadv203.c
+++ b/testcases/kernel/syscalls/preadv2/preadv203.c
@@ -254,7 +254,7 @@ static void setup(void)
 
 		for (j = 0; j < CHUNKS; j++) {
 			memset(buf, '0' + j, sizeof(buf));
-			SAFE_WRITE(1, fds[i], buf, sizeof(buf));
+			SAFE_WRITE_FULLY(fds[i], buf, sizeof(buf));
 		}
 	}
 }
-- 
2.27.0



More information about the ltp mailing list