From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, hch@infradead.org
Subject: Re: [PATCH 2/3] xfs: don't fail unwritten extent conversion on writeback due to edquot
Date: Tue, 19 May 2020 08:46:01 -0400 [thread overview]
Message-ID: <20200519124601.GB23387@bfoster> (raw)
In-Reply-To: <158984935767.619853.515097571114256885.stgit@magnolia>
On Mon, May 18, 2020 at 05:49:17PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> 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>
> fs/xfs/xfs_iomap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index bb590a267a7f..ac970b13b1f8 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -563,7 +563,7 @@ xfs_iomap_write_unwritten(
> xfs_trans_ijoin(tp, ip, 0);
>
> error = xfs_trans_reserve_quota_nblks(tp, ip, resblks, 0,
> - XFS_QMOPT_RES_REGBLKS);
> + XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES);
> if (error)
> goto error_on_bmapi_transaction;
>
>
next prev parent reply other threads:[~2020-05-19 12:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 0:49 [PATCH 0/3] xfs: fix stale disk exposure after crash Darrick J. Wong
2020-05-19 0:49 ` [PATCH 1/3] xfs: force writes to delalloc regions to unwritten Darrick J. Wong
2020-05-19 12:45 ` Brian Foster
2020-05-19 0:49 ` [PATCH 2/3] xfs: don't fail unwritten extent conversion on writeback due to edquot Darrick J. Wong
2020-05-19 7:13 ` Christoph Hellwig
2020-05-19 12:46 ` Brian Foster [this message]
2020-05-19 0:49 ` [PATCH 3/3] xfs: measure all contiguous previous extents for prealloc size Darrick J. Wong
2020-05-19 12:48 ` Brian Foster
2020-05-20 13:23 ` Brian Foster
2020-05-20 19:48 ` Darrick J. Wong
2020-05-21 12:24 ` Brian Foster
2020-05-19 12:54 ` Christoph Hellwig
2020-05-20 21:17 ` Darrick J. Wong
2020-05-21 9:31 ` Christoph Hellwig
2020-05-21 17:19 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200519124601.GB23387@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox