From: "Zhou, Yun" <yun.zhou@windriver.com>
To: Jan Kara <jack@suse.cz>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
libaokun@linux.alibaba.com, ojaswin@linux.ibm.com,
ritesh.list@gmail.com, yi.zhang@huawei.com,
viro@zeniv.linux.org.uk, brauner@kernel.org,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v10 5/5] ext4: prevent deadlock from duplicate EA inode references on corrupted fs
Date: Sun, 28 Jun 2026 16:35:10 +0800 [thread overview]
Message-ID: <c66cf839-ce82-483c-a463-31204cd2cb5b@windriver.com> (raw)
In-Reply-To: <ipqfj2abofanrrcapw2qp4wx6x6m647nqjrhqpuynpxxlh5ugr@utgka6gkeufw>
On 6/27/26 01:23, Jan Kara wrote:
> On Thu 25-06-26 23:29:41, Yun Zhou wrote:
>> On a corrupted filesystem, multiple xattr entries may reference the same
>> EA inode. When ext4_xattr_inode_dec_ref_all() processes such entries, it
>> can dec_ref the EA inode (setting nlink=0) and queue it for deferred iput.
>> If the deferred worker runs before the loop processes the duplicate entry,
>> the second iget() may block on I_FREEING while the worker's eviction waits
>> for the caller's transaction to commit -- classic ABBA deadlock.
>
> Hum, this looks possible but it isn't a new thing this patch set
> introduces. Even before if you had corrupted filesystem,
> ext4_xattr_inode_array_free() from ext4_evict_inode() could deadlock in a
> similar way against say ext4_xattr_inode_dec_ref_all() (but practially
> anything calling ext4_xattr_inode_iget() while holding a transaction
> handle). So please leave this alone for now. We can look into that once
> other EA inode settle.
>
Mainly because sashiko-bot always flags this issue every time. I've further
improved the patch and believe I've thoroughly plugged this loophole. I will
include it in v11, and please take a look when you have a chance. If it
still
has issues, or if you think it's redundant or inelegant, we can just
drop it.
BR,
Yun
next prev parent reply other threads:[~2026-06-28 8:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 15:29 [PATCH v10 0/5] ext4: deferred iput framework for EA inodes Yun Zhou
2026-06-25 15:29 ` [PATCH v10 1/5] fs: add iput_if_not_last() helper Yun Zhou
2026-06-26 16:30 ` Jan Kara
2026-06-25 15:29 ` [PATCH v10 2/5] ext4: introduce ext4_put_ea_inode() for safe deferred iput Yun Zhou
2026-06-26 16:53 ` Jan Kara
2026-06-28 8:13 ` Zhou, Yun
2026-06-29 8:23 ` Jan Kara
2026-06-29 10:05 ` Zhou, Yun
2026-06-25 15:29 ` [PATCH v10 3/5] ext4: convert all EA inode iput() calls to ext4_put_ea_inode() Yun Zhou
2026-06-25 15:29 ` [PATCH v10 4/5] ext4: remove ea_inode_array mechanism in favor of ext4_put_ea_inode() Yun Zhou
2026-06-25 15:29 ` [PATCH v10 5/5] ext4: prevent deadlock from duplicate EA inode references on corrupted fs Yun Zhou
2026-06-26 17:23 ` Jan Kara
2026-06-28 8:35 ` Zhou, Yun [this message]
2026-06-29 8:27 ` Jan Kara
2026-06-28 18:57 ` XIAO WU
2026-06-29 3:17 ` Zhou, Yun
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=c66cf839-ce82-483c-a463-31204cd2cb5b@windriver.com \
--to=yun.zhou@windriver.com \
--cc=adilger.kernel@dilger.ca \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=yi.zhang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox