From: Jeff Layton Date: Thu, 24 May 2018 19:48:39 +0000 (-0500) Subject: xfs_io: syncfs can fail X-Git-Tag: v4.17.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c4889e89b683cecfe53dc50326fb54215958328;p=thirdparty%2Fxfsprogs-dev.git xfs_io: syncfs can fail syncfs can return an error. Report one if it does. Also, ensure that xfs_io will exit with a non-zero status in that case. Signed-off-by: Jeff Layton Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/io/sync.c b/io/sync.c index c77263804..20ab50a7f 100644 --- a/io/sync.c +++ b/io/sync.c @@ -41,8 +41,10 @@ syncfs_f( int argc, char **argv) { - /* syncfs can't fail */ - syncfs(file->fd); + if (syncfs(file->fd) < 0) { + perror("syncfs"); + exitcode = 1; + } return 0; } #endif