From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v5 1/4] btrfs: Reset device size when btrfs_update_device() failed in btrfs_grow_device()
Date: Thu, 9 Jan 2020 09:21:03 -0500 [thread overview]
Message-ID: <69c68e8f-e2f0-0ad9-5c3c-3376246322cd@toxicpanda.com> (raw)
In-Reply-To: <20200109071634.32384-2-wqu@suse.com>
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,
Josef
next prev parent reply other threads:[~2020-01-09 14:21 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 [this message]
2020-01-10 1:40 ` Qu Wenruo
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=69c68e8f-e2f0-0ad9-5c3c-3376246322cd@toxicpanda.com \
--to=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