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