mbox series

[0/3] btrfs-progs: enhance error handling for metadata writeback

Message ID cover.1663934243.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs-progs: enhance error handling for metadata writeback | expand

Message

Qu Wenruo Sept. 23, 2022, 11:59 a.m. UTC
Christoph Anton Mitterer reported a crash if we try to call "btrfs check
--clear-space-cache v2" on a block device which is set read-only by
"blockdev --setro".

For such blockdevice, open() with O_RDWR won't report error immediately,
but only return error when we write to do any writes.

So what we can do is to enhance the error handling of metadata writeback
during transaction commit.

The first 2 patches are cleanups/fixes I exposed during the development.
The last one is the main disk for the fix.

Qu Wenruo (3):
  btrfs-progs: remove unused function extent_io_tree_init_cache_max()
  btrfs-progs: remove duplicated leakde extent buffer reporst
  btrfs-progs: properly handle write error when writing back tree blocks

 kernel-shared/extent_io.c   | 14 ++++++--------
 kernel-shared/extent_io.h   |  2 --
 kernel-shared/transaction.c | 33 +++++++++++++++++++++++++++++++--
 3 files changed, 37 insertions(+), 12 deletions(-)

Comments

David Sterba Sept. 27, 2022, 3:13 p.m. UTC | #1
On Fri, Sep 23, 2022 at 07:59:43PM +0800, Qu Wenruo wrote:
> Christoph Anton Mitterer reported a crash if we try to call "btrfs check
> --clear-space-cache v2" on a block device which is set read-only by
> "blockdev --setro".
> 
> For such blockdevice, open() with O_RDWR won't report error immediately,
> but only return error when we write to do any writes.
> 
> So what we can do is to enhance the error handling of metadata writeback
> during transaction commit.
> 
> The first 2 patches are cleanups/fixes I exposed during the development.
> The last one is the main disk for the fix.
> 
> Qu Wenruo (3):
>   btrfs-progs: remove unused function extent_io_tree_init_cache_max()
>   btrfs-progs: remove duplicated leakde extent buffer reporst
>   btrfs-progs: properly handle write error when writing back tree blocks

Added to devel, thanks.