From: Liu Shixin <liushixin2@huawei.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] fs: sysv: check sbi->s_firstdatazone in complete_read_super
Date: Thu, 31 Mar 2022 11:49:08 +0800 [thread overview]
Message-ID: <a8d491c5-5af5-a9ee-441e-27fdf233eb93@huawei.com> (raw)
In-Reply-To: <YkR6WdjLJyF0PMcd@infradead.org>
The type I used is sysv v7.
I discovered this problem through a syzkaller use case. The use case first create a file
via memfd and bind it to loop0. Then mount it to a folder with type v7. No error is
reported for preceding operations. Finally when create a file, the warning in inc_nlink
is triggered. I want to look the filesystem information, so I execute 'df' command and
find this problem.
Btw, I think the warning may be a follow-up problem caused by the filesystem being
created or mounted incorrectly.
Thanks,
On 2022/3/30 23:42, Christoph Hellwig wrote:
> On Wed, Mar 30, 2022 at 06:42:15PM +0800, Liu Shixin wrote:
>> sbi->s_firstinodezone is initialized to 2 and sbi->s_firstdatazone is read
>> from sbd. There's no guarantee that sbi->s_firstdatazone must bigger than
>> sbi->s_firstinodezone. If sbi->s_firstdatazone less than 2, the filesystem
>> can still be mounted unexpetly. At this point, sbi->s_ninodes flip to very
>> large value and this filesystem is broken. We can observe this by
>> executing 'df' command. When we execute, we will get an error message:
>> "sysv_count_free_inodes: unable to read inode table"
> This looks fine. Just curious: which variant of the sysv fs do you
> use and what is the use case?
> .
>
prev parent reply other threads:[~2022-03-31 4:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 10:42 Liu Shixin
2022-03-30 15:42 ` Christoph Hellwig
2022-03-31 3:49 ` Liu Shixin [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=a8d491c5-5af5-a9ee-441e-27fdf233eb93@huawei.com \
--to=liushixin2@huawei.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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®