mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: pavankumaryalagada@gmail.com, dsterba@suse.com
Cc: mason@kernel.org, fdmanana@suse.com, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	skhan@linuxfoundation.org,
	syzbot+55d1814e49f1fc0ba542@syzkaller.appspotmail.com
Subject: Re: [PATCH] btrfs: Clean up delayed inode items on transaction abort
Date: Tue, 10 Nov 2026 08:37:16 +1030	[thread overview]
Message-ID: <d3e07f45-58f3-4668-b9c2-e0cf63decd4c@gmx.com> (raw)
In-Reply-To: <20261109202914.64371-1-pavankumaryalagada@gmail.com>



在 2026/11/10 06:59, pavankumaryalagada@gmail.com 写道:
> From: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
> 
> When a transaction is aborted, btrfs_commit_inode_delayed_inode()
> fails because btrfs_join_transaction() returns an error. This makes
> btrfs_evict_inode() skip btrfs_kill_delayed_inode_items(), leaving
> pending items in the delayed node.
> 
> Move the error check after btrfs_kill_delayed_inode_items() to
> ensure pending items are removed when the transaction is aborted.
> 
> Reported-by: syzbot+55d1814e49f1fc0ba542@syzkaller.appspotmail.com
> Link: https://lore.kernel.org/all/6af131f2.44d55313.247daf.0001.GAE@google.com/T/
> Fixes: 2adc75d61203 ("btrfs: move btrfs_kill_delayed_inode_items into evict")
> Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
> ---
>   fs/btrfs/inode.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index abaa33471456..397aa64b4816 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -5623,8 +5623,6 @@ void btrfs_evict_inode(struct inode *inode)
>   	 * the inode update is released.
>   	 */
>   	ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode));

What if btrfs_commit_inode_delayed_inode() failed but without a 
transaction abort?

E.g. btrfs_alloc_path() failed inside 
btrfs_commit_inode_delayed_inode(), then the transaction is just ended 
regularly without aborting.

In that case, won't the btrfs_kill_delayed_inode_items() call causing 
problems?
> -	if (ret)
> -		goto out;
>   
>   	/*
>   	 * This drops any pending insert or delete operations we have for this
> @@ -5634,6 +5632,9 @@ void btrfs_evict_inode(struct inode *inode)
>   	 */
>   	btrfs_kill_delayed_inode_items(BTRFS_I(inode));
>   
> +	if (ret)
> +		goto out;
> +
>   	btrfs_init_metadata_block_rsv(fs_info, &rsv, BTRFS_BLOCK_RSV_TEMP);
>   	rsv.size = btrfs_calc_metadata_size(fs_info, 1);
>   	rsv.failfast = true;


      reply	other threads:[~2026-11-09 22:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 20:29 pavankumaryalagada
2026-11-09 22:07 ` Qu Wenruo [this message]

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=d3e07f45-58f3-4668-b9c2-e0cf63decd4c@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    --cc=pavankumaryalagada@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+55d1814e49f1fc0ba542@syzkaller.appspotmail.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

all inboxes | Powered by JetHome®