Re: [PATCH 2/2] xfs_io: syncfs can fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/16/18 8:27 AM, Jeff Layton wrote:
From: Jeff Layton <jlayton@xxxxxxxxxx>

syncfs can return an error. Report one if it does.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux