On Thu, Jul 02, 2020 at 08:02:52AM +0800, Qu Wenruo <quwenruo.btrfs@xxxxxxx> wrote:
> 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?
I wouldn't see how, especially if the code doesn't do anything _unless_ it
also prints the message.
When it doesn't produce the message, all it does is compare two numbers
(unless btrfs_super_total_bytes does something very funny) - how does this
explain that the mount fails, then succeeds, in the cases where the message
is _not_ logged, as reported?
> > 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.
Not sure how that follows - there is a bug in the kernel filesystem and
you provide a userspace tool that should be run on every crash, to what
end?
Spurious mount failures are a bug in the btrfs kernel driver.
> > The bug I reported has very little or nothing to with strict checking.
>
> I have provide the code to prove why it's related.
The code proves only that you are wrong - the code _always_ prints the
message. Unless btrfs_super_total_bytes does more than just read some
data, it cannot explain the bug I reported, simply because the message is
not always produced, and the mount is not always aborted.
> Whether you believe is your problem then.
No, it's not, simply because I don't have a problem...
btrfs has problems, and I reported one, that's all that has happened.
I slowly get the distinct feeling that reporting bugs in btrfs us a futile
exercise, though.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp@xxxxxxxxxx
-=====/_/_//_/\_,_/ /_/\_\