From: Filipe Manana Date: Fri, 23 May 2025 17:20:50 +0000 (+0100) Subject: fsstress: print syncfs() return value in verbose mode X-Git-Tag: v2025.06.08~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f635d075e104e69d58dc48c88697c64181a22b6;p=xfstests-dev.git fsstress: print syncfs() return value in verbose mode We aren't logging the syncfs() return value in case we are running in verbose mode, which is useful and it would help me immediately figuring out it was failing in a problem I was debugging with btrfs. So log its return value, just like we do for every other fsstress command. Signed-off-by: Filipe Manana Signed-off-by: Zorro Lang --- diff --git a/ltp/fsstress.c b/ltp/fsstress.c index ed9d5fa1..8dbfb81f 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -5326,14 +5326,15 @@ void sync_f(opnum_t opno, long r) { int fd; + int e; fd = open(homedir, O_RDONLY|O_DIRECTORY); if (fd < 0) goto use_sync; - syncfs(fd); + e = syncfs(fd) < 0 ? errno : 0; close(fd); if (verbose) - printf("%d/%lld: syncfs\n", procid, opno); + printf("%d/%lld: syncfs %d\n", procid, opno, e); return; use_sync: