From: Greg KH <greg@kroah.com>
To: Qu Wenruo <wqu@suse.com>
Cc: stable@vger.kernel.org, David Sterba <dsterba@suse.com>
Subject: Re: [PATCH 1/2] btrfs: Enhance btrfs_trim_fs function to handle error better
Date: Mon, 19 Nov 2018 13:30:16 +0100 [thread overview]
Message-ID: <20181119123016.GA18911@kroah.com> (raw)
In-Reply-To: <20181112003242.17674-1-wqu@suse.com>
On Mon, Nov 12, 2018 at 08:32:41AM +0800, Qu Wenruo wrote:
> Commit 93bba24d4b5ad1e5cd8b43f64e66ff9d6355dd20 upstream.
>
> Function btrfs_trim_fs() doesn't handle errors in a consistent way. If
> error happens when trimming existing block groups, it will skip the
> remaining blocks and continue to trim unallocated space for each device.
>
> The return value will only reflect the final error from device trimming.
>
> This patch will fix such behavior by:
>
> 1) Recording the last error from block group or device trimming
> The return value will also reflect the last error during trimming.
> Make developer more aware of the problem.
>
> 2) Continuing trimming if possible
> If we failed to trim one block group or device, we could still try
> the next block group or device.
>
> 3) Report number of failures during block group and device trimming
> It would be less noisy, but still gives user a brief summary of
> what's going wrong.
>
> Such behavior can avoid confusion for cases like failure to trim the
> first block group and then only unallocated space is trimmed.
>
> Reported-by: Chris Murphy <lists@colorremedies.com>
> CC: stable@vger.kernel.org # 4.9
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> Reviewed-by: David Sterba <dsterba@suse.com>
> [ add bg_ret and dev_ret to the messages ]
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/extent-tree.c | 40 +++++++++++++++++++++++++++++-----------
> 1 file changed, 29 insertions(+), 11 deletions(-)
Does not apply to the latest 4.9.y tree :(
Can you please rebase and resend both of these?
thanks,
greg k-h
next prev parent reply other threads:[~2018-11-19 22:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 0:32 [PATCH 1/2] btrfs: Enhance btrfs_trim_fs function to handle error better Qu Wenruo
2018-11-12 0:32 ` [PATCH 2/2] btrfs: Ensure btrfs_trim_fs can trim the whole filesystem Qu Wenruo
2018-11-19 12:30 ` Greg KH [this message]
2018-11-20 2:10 ` [PATCH 1/2] btrfs: Enhance btrfs_trim_fs function to handle error better Qu Wenruo
-- strict thread matches above, loose matches on Subject: below --
2018-11-20 2:26 Qu Wenruo
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=20181119123016.GA18911@kroah.com \
--to=greg@kroah.com \
--cc=dsterba@suse.com \
--cc=stable@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