From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, hch@infradead.org
Subject: [PATCH 3/3] xfs: attach dquots before performing xfs_swap_extents
Date: Sun, 10 Nov 2019 17:18:34 -0800 [thread overview]
Message-ID: <157343511427.1948946.2692071497822316839.stgit@magnolia> (raw)
In-Reply-To: <157343509505.1948946.5379830250503479422.stgit@magnolia>
From: Darrick J. Wong <darrick.wong@oracle.com>
Make sure we attach dquots to both inodes before swapping their extents.
This was found via manual code inspection by looking for places where we
could call xfs_trans_mod_dquot without dquots attached to inodes, and
confirmed by instrumenting the kernel and running xfs/328.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/xfs_bmap_util.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 9d731b71e84f..2efd78a9719e 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1569,6 +1569,14 @@ xfs_swap_extents(
goto out_unlock;
}
+ error = xfs_qm_dqattach(ip);
+ if (error)
+ goto out_unlock;
+
+ error = xfs_qm_dqattach(tip);
+ if (error)
+ goto out_unlock;
+
error = xfs_swap_extent_flush(ip);
if (error)
goto out_unlock;
next prev parent reply other threads:[~2019-11-11 1:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 1:18 [PATCH 0/3] xfs: various fixes Darrick J. Wong
2019-11-11 1:18 ` [PATCH 1/3] xfs: actually check xfs_btree_check_block return in xfs_btree_islastblock Darrick J. Wong
2019-11-11 7:57 ` Christoph Hellwig
2019-11-11 1:18 ` [PATCH 2/3] xfs: attach dquots and reserve quota blocks during unwritten conversion Darrick J. Wong
2019-11-11 7:59 ` Christoph Hellwig
2019-11-11 1:18 ` Darrick J. Wong [this message]
2019-11-11 8:05 ` [PATCH 3/3] xfs: attach dquots before performing xfs_swap_extents Christoph Hellwig
2019-11-12 22:14 ` Dave Chinner
2019-11-14 14:53 ` Christoph Hellwig
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=157343511427.1948946.2692071497822316839.stgit@magnolia \
--to=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;
as well as URLs for NNTP newsgroup(s).