From: "Zhou, Yun" <yun.zhou@windriver.com>
To: jack@suse.cz
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, 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
Subject: Re: [PATCH v12 2/4] ext4: introduce ext4_put_ea_inode() for safe deferred iput
Date: Tue, 30 Jun 2026 18:15:29 +0800 [thread overview]
Message-ID: <8ea2cd60-f453-47ea-8549-7911a7b28a0d@windriver.com> (raw)
In-Reply-To: <20260630100829.1257618-3-yun.zhou@windriver.com>
Hi Honza,
On 6/30/26 18:08, Yun Zhou wrote:
> +/*
> + * Release a VFS reference on an EA inode. Must be used instead of iput()
> + * in any context where xattr_sem or a jbd2 handle is held.
> + *
> + * If this is not the last reference, drops it immediately via
> + * iput_if_not_last() with no further action needed.
> + *
> + * If this is the last reference, the inode is linked onto a per-sb
> + * llist via i_ea_iput_node (embedded in ext4_inode_info, sharing space
> + * with the unused xattr_sem) and a delayed worker performs the final
> + * iput() in a clean context.
> + *
> + * Note: while an inode is on s_ea_inode_to_free, the unconsumed i_count
> + * reference (still 1) keeps it in the inode cache, so any concurrent
> + * iget() bumps i_count to >= 2 and iput_if_not_last() will succeed.
> + * Nobody will add the inode a second time until ext4_ea_inode_work()
> + * drops that reference via iput().
> + */
> +void ext4_put_ea_inode(struct inode *inode)
> +{
> + if (!inode)
> + return;
> + WARN_ON_ONCE(!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL));
> + if (iput_if_not_last(inode))
> + return;
> + llist_add(&EXT4_I(inode)->i_ea_iput_node,
> + &EXT4_SB(inode->i_sb)->s_ea_inode_to_free);
> + /*
> + * Use a short delay to allow multiple EA inodes to accumulate,
> + * reducing workqueue wakeups when several are released together.
> + */
> + schedule_delayed_work(&EXT4_SB(inode->i_sb)->s_ea_inode_work, 1);
> +}
> +
Could you please help me review this patch again? I have reduced the
parameter of ext4_put_ea_inode() to one.
>
> extern int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
> struct ext4_inode *raw_inode, handle_t *handle);
Thanks,
Yun
next prev parent reply other threads:[~2026-06-30 10:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 10:08 [PATCH v12 0/4] ext4: deferred iput framework for EA inodes Yun Zhou
2026-06-30 10:08 ` [PATCH v12 1/4] fs: add iput_if_not_last() helper Yun Zhou
2026-06-30 10:08 ` [PATCH v12 2/4] ext4: introduce ext4_put_ea_inode() for safe deferred iput Yun Zhou
2026-06-30 10:15 ` Zhou, Yun [this message]
2026-06-30 11:49 ` Jan Kara
2026-06-30 10:08 ` [PATCH v12 3/4] ext4: convert all EA inode iput() calls to ext4_put_ea_inode() Yun Zhou
2026-06-30 10:08 ` [PATCH v12 4/4] ext4: remove ea_inode_array mechanism in favor of ext4_put_ea_inode() Yun Zhou
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=8ea2cd60-f453-47ea-8549-7911a7b28a0d@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