From: Dave Chinner <david@fromorbit.com>
To: kaixuxia <xiakaixu1987@gmail.com>
Cc: Brian Foster <bfoster@redhat.com>,
linux-xfs@vger.kernel.org,
"Darrick J. Wong" <darrick.wong@oracle.com>,
newtongao@tencent.com, jasperwang@tencent.com
Subject: Re: [PATCH V2] xfs: Fix agi&agf ABBA deadlock when performing rename with RENAME_WHITEOUT flag
Date: Tue, 20 Aug 2019 18:07:42 +1000 [thread overview]
Message-ID: <20190820080741.GE1119@dread.disaster.area> (raw)
In-Reply-To: <718fa074-2c33-280e-c664-6afcc3bfe777@gmail.com>
On Tue, Aug 20, 2019 at 02:45:36PM +0800, kaixuxia wrote:
> On 2019/8/19 23:13, Brian Foster wrote:
> > /* error checks before we dirty the transaction */
> > if (!target_ip && !spaceres) {
> > error = xfs_dir_canenter();
> > ...
> > } else if (S_ISDIR() && !(empty || nlink > 2))
> > error = -EEXIST;
> > ...
> > }
> >
> > if (wip) {
> > ...
> > xfs_iunlink_remove();
> > }
> >
> > if (!target_ip) {
> > xfs_dir_create();
> > ...
> > } else {
> > xfs_dir_replace();
> > ...
> > }
> >
> > ... but that may not be any cleaner..? It could also be done as a
> > followup cleanup patch as well.
>
> Yep, it is cleaner that making the whole check before the transaction
> becomes dirty, just return the error code if check failed and
> the filesystem is clean.
*nod*
> Dave gave another solution in the other subthread that using
> XFS_DIR3_FT_WHT, it's a bit more work for this bug, include
> refactoring the xfs_rename() and xfs_lookup(), not sure whether
> it's worth the complex changes for this bug.
It's not necessary to fix the bug, but it's somethign we should
be looking to do because it makes whiteout handling a lot more
efficient - it's just dirent modifications at that point, no inodes
are necessary.
This is how I always intended to handle whiteouts - it's just
another thing on the "we need to fix" list....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-20 8:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 13:06 [PATCH V2] xfs: Fix agi&agf ABBA deadlock when performing rename with RENAME_WHITEOUT flag kaixuxia
2019-08-19 15:13 ` Brian Foster
2019-08-19 22:12 ` Dave Chinner
2019-08-20 6:45 ` kaixuxia
2019-08-20 8:07 ` Dave Chinner [this message]
2019-08-20 8:53 ` kaixuxia
2019-08-20 10:51 ` Brian Foster
2019-08-20 11:23 ` Dave Chinner
2019-08-20 12:23 ` Brian Foster
2019-08-20 22:13 ` Dave Chinner
2019-08-21 11:25 ` Brian Foster
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=20190820080741.GE1119@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=jasperwang@tencent.com \
--cc=linux-xfs@vger.kernel.org \
--cc=newtongao@tencent.com \
--cc=xiakaixu1987@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.