Message ID | 20180621131956.6951-1-lczerner@redhat.com |
---|---|
State | Accepted, archived |
Headers | show |
Series | filefrag: don't ignore fsync errors | expand |
On Thu, Jun 21, 2018 at 03:19:56PM +0200, Lukas Czerner wrote:
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Applied, thanks.
- Ted
diff --git a/misc/filefrag.c b/misc/filefrag.c index dc003931..c8444d76 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -306,8 +306,8 @@ static int filefrag_fibmap(int fd, int blk_shift, int *num_extents, fm_ext.fe_flags = FIEMAP_EXTENT_MERGED; } - if (sync_file) - fsync(fd); + if (sync_file && fsync(fd) != 0) + return -errno; for (i = 0, logical = 0, *num_extents = 0, count = last_block = 0; i < numblocks;
Signed-off-by: Lukas Czerner <lczerner@redhat.com> --- misc/filefrag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)