From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Marc Lehmann <schmorp@schmorp.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: first mount(s) after unclean shutdown always fail
Date: Thu, 2 Jul 2020 08:02:52 +0800 [thread overview]
Message-ID: <25e94ec6-842c-310f-e105-6d8f1e6dfdce@gmx.com> (raw)
In-Reply-To: <20200701235512.GA3231@schmorp.de>
[-- Attachment #1.1: Type: text/plain, Size: 1849 bytes --]
On 2020/7/2 上午7:55, Marc Lehmann wrote:
> On Thu, Jul 02, 2020 at 07:45:07AM +0800, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>> On 2020/7/2 上午4:14, Marc Lehmann wrote:
>>> On Wed, Jul 01, 2020 at 09:30:25AM +0800, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>>>> This looks like an old fs with some bad accounting numbers.
>>>
>>> Yeah, but it's not.
>>>
>>>> Have you tried btrfs rescue fix-device-size?
>>>
>>> Why would I want to try this?
>>
>> Read the man page of "btrfs-rescue".
>
> Well, nothing in there explains why I should use it in my situation, or
> what it has to do with the problem I reported, so again, why would I want
> to do this?
Well, if you want to go this way, let me show the code here.
From fs/btrfs/volumes.c:btrfs_read_chunk_tree():
if (btrfs_super_total_bytes(fs_info->super_copy) <
fs_info->fs_devices->total_rw_bytes) {
btrfs_err(fs_info,
"super_total_bytes %llu mismatch with fs_devices total_rw_bytes
%llu",
btrfs_super_total_bytes(fs_info->super_copy),
fs_info->fs_devices->total_rw_bytes);
ret = -EINVAL;
goto error;
}
Doesn't this explain why we abort the mount?
>
> Also, shouldn't btrfs be fixed instead? I was under the impression that
> one of the goals of btrfs is to be safe w.r.t. crashes.
That's why we provide the btrfs rescue fix-device-size.
We don't want to spend too complex logic on some already screwed
accounting numbers.
Furthermore, a btrfs check run without --repair may expose more problems.
>
> The bug I reported has very little or nothing to with strict checking.
>
I have provide the code to prove why it's related.
Whether you believe is your problem then.
Thanks,
Qu
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-07-02 0:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 0:51 first mount(s) after unclean shutdown always fail Marc Lehmann
2020-07-01 1:30 ` Qu Wenruo
2020-07-01 20:14 ` Marc Lehmann
2020-07-01 23:45 ` Qu Wenruo
2020-07-01 23:55 ` Marc Lehmann
2020-07-02 0:02 ` Qu Wenruo [this message]
2020-07-02 1:11 ` Marc Lehmann
2020-07-02 1:28 ` Qu Wenruo
2020-07-02 2:13 ` Marc Lehmann
2020-07-02 18:31 ` Zygo Blaxell
2020-07-03 8:04 ` Marc Lehmann
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=25e94ec6-842c-310f-e105-6d8f1e6dfdce@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=schmorp@schmorp.de \
/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;
as well as URLs for NNTP newsgroup(s).