OSDN Git Service

xfs: don't fail unwritten extent conversion on writeback due to edquot
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 23 May 2020 16:43:30 +0000 (09:43 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 27 May 2020 15:49:28 +0000 (08:49 -0700)
commit1edd2c055dff9710b1e29d4df01902abb0a55f1f
treeec5891cb72999f1e7b1b64f31b5078633240c0c4
parent964176bd32da9847112b505f57ee6e602ee5c84d
xfs: don't fail unwritten extent conversion on writeback due to edquot

During writeback, it's possible for the quota block reservation in
xfs_iomap_write_unwritten to fail with EDQUOT because we hit the quota
limit.  This causes writeback errors for data that was already written
to disk, when it's not even guaranteed that the bmbt will expand to
exceed the quota limit.  Irritatingly, this condition is reported to
userspace as EIO by fsync, which is confusing.

We wrote the data, so allow the reservation.  That might put us slightly
above the hard limit, but it's better than losing data after a write.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_iomap.c