From: Baokun Li <libaokun1@huawei.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Edward Adam Davis <eadavis@qq.com>,
<syzbot+2c4a3b922a860084cc7f@syzkaller.appspotmail.com>,
<adilger.kernel@dilger.ca>, <linux-ext4@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<syzkaller-bugs@googlegroups.com>, <tytso@mit.edu>,
yangerkun <yangerkun@huawei.com>,
Baokun Li <libaokun1@huawei.com>
Subject: Re: [PATCH] ext4: fix WARNING in lock_two_nondirectories
Date: Mon, 25 Dec 2023 10:33:20 +0800 [thread overview]
Message-ID: <a4d6ca25-cb8d-f3f9-ed4e-3a55378fdfde@huawei.com> (raw)
In-Reply-To: <20231225020754.GE1674809@ZenIV>
On 2023/12/25 10:07, Al Viro wrote:
> On Mon, Dec 25, 2023 at 09:38:51AM +0800, Baokun Li wrote:
>
>> In my opinion, it doesn't make sense to call lock_two_nondirectories()
>> here to determine if the inode is a regular file or not, since the logic
>> for dealing with non-regular files comes after the locking, so calling
>> lock_two_inodes() directly here will suffice.
> No. First of all, lock_two_inodes() is a mistake that is going to be
> removed in the coming cycle.
Okay, I didn't know about this.
> What's more, why the hell do you need to lock *anything* to check the
> inode type? Inode type never changes, period.
>
> Just take that check prior to lock_two_nondirectories() and be done with
> that.
Since in the current logic we update the boot loader file via
swap_inode_boot_loader(), however the boot loader inode on disk
may be uninitialized and may be garbage data, so we allow to get a
bad boot loader inode and then initialize it and swap it with the boot
loader file to be set.
When reinitializing the bad boot loader inode, something like an
inode type conversion may occur.
Cheers,
Baokun
next prev parent reply other threads:[~2023-12-25 2:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 13:49 [syzbot] [ext4?] WARNING in lock_two_nondirectories syzbot
2023-12-24 11:53 ` [PATCH] ext4: fix " Edward Adam Davis
2023-12-24 14:13 ` Matthew Wilcox
2023-12-25 1:38 ` Baokun Li
2023-12-25 2:07 ` Al Viro
2023-12-25 2:33 ` Baokun Li [this message]
2023-12-25 2:49 ` Theodore Ts'o
2023-12-25 2:56 ` Baokun Li
2023-12-25 2:11 ` Theodore Ts'o
2023-12-25 2:15 ` Al Viro
2023-12-25 2:46 ` Baokun Li
2024-02-12 0:00 ` [syzbot] [ext4?] " syzbot
2024-02-12 13:28 ` Jan Kara
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=a4d6ca25-cb8d-f3f9-ed4e-3a55378fdfde@huawei.com \
--to=libaokun1@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=eadavis@qq.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+2c4a3b922a860084cc7f@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=yangerkun@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