public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Theodore Tso <tytso@mit.edu>,
	syzbot <syzbot+bb2455d02bda0b5701e3@syzkaller.appspotmail.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [ext4?] possible deadlock in ext4_destroy_inline_data (2)
Date: Mon, 1 Dec 2025 15:25:52 -0800	[thread overview]
Message-ID: <20251201232552.GA89435@frogsfrogsfrogs> (raw)
In-Reply-To: <2ED9BD8E-9A4D-4800-8633-9FEAD464049D@dilger.ca>

On Mon, Dec 01, 2025 at 04:17:02PM -0700, Andreas Dilger wrote:
> On Dec 1, 2025, at 9:16 AM, Theodore Tso <tytso@mit.edu> wrote:
> > 
> > That being said, we probably should just not try to expand the inode's
> > extra size while evicting the inode.  In practice we don't actually do
> > this since we haven't expanded the inode's extra size space in over a
> > decade, and so this only happens in a debugging mount option that
> > syzbot helpfully uses, and not in real life.
> 
> I think we would regret removing this if/when we *do* expand the inode
> size.  We used this functionality to upgrade filesystems online when
> i_projid was first added and users suddenly wanted to use project quotas.
> If we need some new inode field in the future it will be good to have it.

Or expand extra_isize only when someone tries to set an inode field that
actually requires it?  e.g. whenever setting the project id?

--D

> > Also, there's no real point in doing this on the evict path,
> > especially if the inode is about to be released as part of the
> > eviction.
> 
> This could check in ext4_orphan_cleanup()->ext4_evict_inode() path
> that this is orphan cleanup with EXT4_ORPHAN_FS and skip the expansion?
> As you write, it doesn't make sense to do that when the file is being
> deleted anyway.  Something like the following, which adds unlikely() to
> that branch since it may happen only once or never in the lifetime of
> any inode:
> 
> Cheers, Andreas
> ---
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index e99306a8f47c..ae48748decc5 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -6481,7 +6490,8 @@ int __ext4_mark_inode_dirty(handle_t *handle,
>  	if (err)
>  		goto out;
> -	if (EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize)
> +	if (unlikely(EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize &&
> +		     !(sbi->s_mount_state & EXT4_ORPHAN_FS)))
>  		ext4_try_to_expand_extra_isize(inode, sbi->s_want_extra_isize,
>  					       iloc, handle);
> 
> 
> 
> 
> 
> 

  reply	other threads:[~2025-12-01 23:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 22:08 [syzbot] [ext4?] possible deadlock in ext4_destroy_inline_data (2) syzbot
2025-12-01  6:21 ` syzbot
2025-12-01 16:16 ` Theodore Tso
2025-12-01 23:17   ` Andreas Dilger
2025-12-01 23:25     ` Darrick J. Wong [this message]
2025-12-02  1:56       ` Theodore Tso
2025-12-02  1:14     ` Theodore Tso

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=20251201232552.GA89435@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+bb2455d02bda0b5701e3@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tytso@mit.edu \
    /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