]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fsstress: print syncfs() return value in verbose mode
authorFilipe Manana <fdmanana@suse.com>
Fri, 23 May 2025 17:20:50 +0000 (18:20 +0100)
committerZorro Lang <zlang@kernel.org>
Fri, 6 Jun 2025 01:55:44 +0000 (09:55 +0800)
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 <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
ltp/fsstress.c

index ed9d5fa1efc3d96871f3e4f455edd21b31ef92ed..8dbfb81f95a53893ca96318ef77ddd32c92b82c3 100644 (file)
@@ -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: