From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Josef Bacik <josef@toxicpanda.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH v5 1/4] btrfs: Reset device size when btrfs_update_device() failed in btrfs_grow_device()
Date: Fri, 10 Jan 2020 09:40:34 +0800 [thread overview]
Message-ID: <4bb19ef4-af6d-0c3e-2588-bbee5153aa0a@gmx.com> (raw)
In-Reply-To: <69c68e8f-e2f0-0ad9-5c3c-3376246322cd@toxicpanda.com>
[-- Attachment #1.1: Type: text/plain, Size: 1665 bytes --]
On 2020/1/9 下午10:21, Josef Bacik wrote:
> On 1/9/20 2:16 AM, Qu Wenruo wrote:
>> When btrfs_update_device() failed due to ENOMEM, we didn't reset device
>> size back to its original size, causing the in-memory device size larger
>> than original.
>>
>> If somehow the memory pressure get solved, and the fs committed, since
>> the device item is not updated, but super block total size get updated,
>> it would cause mount failure due to size mismatch.
>>
>> So here revert device size and super size to its original size when
>> btrfs_update_device() failed, just like what we did in shrink_device().
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> Did you test this with error injection to make sure nothing else wonky
> came out of this? If you are going to fix this I'd rather it be in a
> different series because it's not necessarily related to what you are
> doing, and isn't any more broken with your other patches. The thing you
> are fixing in this series is important and I'd rather not hold it up on
> some error handling shenanigans. Thanks,
Yes, I have the same feeling.
But sometimes I just can't stop addressing the comment that makes sense.
And you're right, I forgot the error injection test, and it detects one bug.
In the error handling path, I forgot the re-update per-profile
available, causing df showing the grown size, not the old size.
To David, what's your idea on this?
I guess the patchset can't be backported anyway due to new infrastructure.
I'm OK solving the problem by either removing this patch, or fix the bug
exposed by the error injection.
Thanks,
Qu
>
> Josef
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-01-10 1:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 7:16 [PATCH v5 0/4] Introduce per-profile available space array to avoid over-confident can_overcommit() Qu Wenruo
2020-01-09 7:16 ` [PATCH v5 1/4] btrfs: Reset device size when btrfs_update_device() failed in btrfs_grow_device() Qu Wenruo
2020-01-09 14:21 ` Josef Bacik
2020-01-10 1:40 ` Qu Wenruo [this message]
2020-01-15 7:05 ` Qu Wenruo
2020-01-09 7:16 ` [PATCH v5 2/4] btrfs: Introduce per-profile available space facility Qu Wenruo
2020-01-09 14:46 ` Josef Bacik
2020-01-18 12:51 ` kbuild test robot
2020-01-09 7:16 ` [PATCH v5 3/4] btrfs: space-info: Use per-profile available space in can_overcommit() Qu Wenruo
2020-01-09 7:16 ` [PATCH v5 4/4] btrfs: statfs: Use pre-calculated per-profile available space Qu Wenruo
2020-01-09 14:45 ` Josef Bacik
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=4bb19ef4-af6d-0c3e-2588-bbee5153aa0a@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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