Message ID | 20180516132738.27776-2-jlayton@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On 5/16/18 8:27 AM, Jeff Layton wrote: > From: Jeff Layton <jlayton@redhat.com> > > syncfs can return an error. Report one if it does. > > Signed-off-by: Jeff Layton <jlayton@redhat.com> > --- > io/sync.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/io/sync.c b/io/sync.c > index c77263804a35..868cea7c051e 100644 > --- a/io/sync.c > +++ b/io/sync.c > @@ -41,8 +41,8 @@ syncfs_f( > int argc, > char **argv) > { > - /* syncfs can't fail */ > - syncfs(file->fd); > + if (syncfs(file->fd) < 0) > + perror("syncfs"); In light of dchinner's recent reminder on another of my patches, this should also set exitcode=1 here, so that the overall xfs_io exit code will be non-zero if syncfs fails. (I could just add that on merge if you prefer... assuming I remember) Thanks, -Eric > return 0; > } > #endif > -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/io/sync.c b/io/sync.c index c77263804a35..868cea7c051e 100644 --- a/io/sync.c +++ b/io/sync.c @@ -41,8 +41,8 @@ syncfs_f( int argc, char **argv) { - /* syncfs can't fail */ - syncfs(file->fd); + if (syncfs(file->fd) < 0) + perror("syncfs"); return 0; } #endif