block: preserve errno from fdatasync failures
commitc7ddc8821d88d958bb6d4ef1279ec3609b17ffda
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 15 Apr 2021 13:28:16 +0000 (15 14:28 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 14 Jun 2021 12:28:50 +0000 (14 13:28 +0100)
treee5754ff57554c957912e154efa488a63918e8d1d
parent8af3f5c6d66ac203000c2d8ebebd3b751f575008
block: preserve errno from fdatasync failures

When fdatasync() fails on a file backend we set a flag that
short-circuits any future attempts to call fdatasync(). The
first failure returns the true errno, but the later short-
circuited calls return a generic EIO. The latter is unhelpful
because fdatasync() can return a variety of errnos, including
EACCESS.

Reviewed-by: Connor Kuehl <ckuehl@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
block/file-posix.c