mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Helen Koike <koike@igalia.com>, <eadavis@qq.com>,
	<ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<kernel-dev@igalia.com>
Subject: Re: [PATCH] fs/ntfs3: call _ntfs_bad_inode() when failing to rename
Date: Tue, 26 May 2026 12:02:26 +0200	[thread overview]
Message-ID: <496d8029-fe29-4403-9466-299bd14d2467@paragon-software.com> (raw)
In-Reply-To: <20260506170842.532401-1-koike@igalia.com>

On 5/6/26 19:08, Helen Koike wrote:

> It is safe to call _ntfs_bad_inode on live inodes since:
>    commit 519b078998ce ("fs/ntfs3: Exclude call make_bad_inode for live nodes.")
>
> The WARN_ON was added when it wasn't safe by:
>    commit d99208b91933 ("fs/ntfs3: cancle set bad inode after removing name fails")
>
> Replace the WARN_ON with a call to _ntfs_bad_inode() to prevent further
> operations on the inconsistent inode.
>
> Reported-by: syzbot+4d8e30dbafb5c1260479@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=4d8e30dbafb5c1260479
> Fixes: 519b078998ce ("fs/ntfs3: Exclude call make_bad_inode for live nodes.")
> Signed-off-by: Helen Koike <koike@igalia.com>
> ---
>   fs/ntfs3/frecord.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index 7b035da63c12..78eb065c7e43 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -2800,8 +2800,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
>   	err = ni_add_name(new_dir_ni, ni, new_de);
>   	if (!err) {
>   		err = ni_remove_name(dir_ni, ni, de, &de2, &undo);
> -		WARN_ON(err &&
> -			ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo));
> +		if (err && ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo))
> +			_ntfs_bad_inode(&ni->vfs_inode);
>   	}
>   
>   	/*

Hello,

Your patch was applied, thanks.

Regards,
Konstantin


      reply	other threads:[~2026-05-26 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 17:08 Helen Koike
2026-05-26 10:02 ` Konstantin Komarov [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=496d8029-fe29-4403-9466-299bd14d2467@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=eadavis@qq.com \
    --cc=kernel-dev@igalia.com \
    --cc=koike@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /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®