From: Jeff Mahoney je...@suse.com
Since we now clean up block groups automatically as they become
empty, iterating over block groups is no longer sufficient to discard
unused space.
This patch iterates over the unused chunk space and discards any regions
that are unallocated, regardless of
From: Jeff Mahoney je...@suse.com
When we clear the dirty bits in btrfs_delete_unused_bgs for extents
in the empty block group, it results in btrfs_finish_extent_commit being
unable to discard the freed extents.
The block group removal patch added an alternate path to forget extents
other than
From: Jeff Mahoney je...@suse.com
Btrfs doesn't track superblocks with extent records so there is nothing
persistent on-disk to indicate that those blocks are in use. We track
the superblocks in memory to ensure they don't get used by removing them
from the free space cache when we load a block
From: Jeff Mahoney je...@suse.com
Since we now clean up block groups automatically as they become
empty, iterating over block groups is no longer sufficient to discard
unused space.
This patch iterates over the unused chunk space and discards any regions
that are unallocated, regardless of
The automatic block group removal patch introduced some regressions
in how discards are handled.
1/ FITRIM only iterates over block groups on disk - removed block groups
won't be trimmed.
2/ Clearing the dirty bit from extents in removed block groups means that
those extents won't be
From: Jeff Mahoney je...@suse.com
Overloading extent_map-bdev to struct map_lookup * might have started out
as a means to an end, but it's a pattern that's used all over the place
now. Let's get rid of the casting and just add a union instead.
Signed-off-by: Jeff Mahoney je...@suse.com
---
From: Jeff Mahoney je...@suse.com
When we clear the dirty bits in btrfs_delete_unused_bgs for extents
in the empty block group, it results in btrfs_finish_extent_commit being
unable to discard the freed extents.
The block group removal patch added an alternate path to forget extents
other than
The automatic block group removal patch introduced some regressions
in how discards are handled.
1/ FITRIM only iterates over block groups on disk - removed block groups
won't be trimmed.
2/ Clearing the dirty bit from extents in removed block groups means that
those extents won't be
From: Jeff Mahoney je...@suse.com
The cleaner thread may already be sleeping by the time we enter
close_ctree. If that's the case, we'll skip removing any unused
block groups queued for removal, even during a normal umount.
They'll be cleaned up automatically at next mount, but users
expect a
btrfs_invalidate_inodes has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |2 +-
fs/btrfs/inode.c |3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2590,7 +2590,7 @@
btrfs_submit_bio_hook currently calls btrfs_bio_wq_end_io in either case
of an if statement that determines one of the arguments.
This patch moves the function call outside of the if statement and uses it
to only determine the different argument. This allows us to catch an
error in one place
This patch handles btrfs_start_transaction failures that don't occur
in a loop and are obvious to simply push up. In all cases except the
mark_garbage_root case, the error is already handled by BUG_ON in the
caller.
Update v2: This version also checks the returns from btrfs_drop_snapshot.
This pushes failures from the submit_bio_hook callbacks,
btrfs_submit_bio_hook and btree_submit_bio_hook into the callers, including
callers of submit_one_bio where it catches the failures with BUG_ON.
It also pushes up through the -readpage_io_failed_hook to
end_bio_extent_writepage where
btrfs_init_compress doesn't have any failure conditions, so return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/compression.h |2 +-
fs/btrfs/super.c |5 +
2 files changed, 2 insertions(+), 5 deletions(-)
--- a/fs/btrfs/compression.c
+++
lock_extent, try_lock_extent, and lock_extent_bits can't currently fail
because errors are caught via BUG_ON.
This patch pushes the error handling up to callers, which currently
only handle them via BUG_ON themselves.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/compression.c
The previous patch pushed the clear_extent_bit error handling up a level,
which included unlock_extent and unlock_extent_cache.
This patch pushes the BUG_ON up into the callers of those functions.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/compression.c |9 ++--
btrfs_prepare_extent_commit, btrfs_set_block_group_rw, and
setup_inline_extent_backref have no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |8
fs/btrfs/extent-tree.c | 20 +---
2 files changed, 13
wait_on_state, wait_extent_bit, __unlock_for_delalloc, check_page_uptodate,
check_page_locked, check_page_writeback, and clear_extent_buffer_dirty
have no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c | 29
In the locking case, set_extent_bit can return -EEXIST but callers
already handle that.
In the non-locking case, it can't fail. Memory allocation failures are
handled by BUG_ON.
This patch pushes up the BUG_ONs from set_extent_bit to callers, except
where -ENOMEM can't occur (e.g.
clear_extent_bit can fail with -ENOMEM for a specific case but will BUG
on other memory allocation failures.
This patch returns -ENOMEM for memory allocation failures and handles them
with BUG_ON in callers which don't handle it already.
Signed-off-by: Jeff Mahoney je...@suse.com
---
Commit cb1b69f4 (Btrfs: forced readonly when btrfs_drop_snapshot() fails)
made btrfs_drop_snapshot return void because there were no callers checking
the return value. That is the wrong order to handle error propogation since
the caller will have no idea that an error has occured and continue on
btrfs_destroy_delalloc_inodes and __setup_root have no error conditions and
should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/disk-io.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -54,7
btrfs_run_defrag_inodes contains no error conditions and should return
void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |2 +-
fs/btrfs/file.c |3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2612,7
set_range_writeback has no error conditions that aren't fatal logic errors.
This patch makes it return void to eliminate an error site.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
---
btrfs_pin_extent looks up a block group and then calls pin_down_extent
with it. If the lookup fails, it should return -ENOENT to allow callers
to handle the error condition. For the three existing callers, it is
a logic error if the lookup fails and a panic will occur.
Signed-off-by: Jeff
pin_down_extent performs some operations which can't fail and then calls
set_extent_dirty, which has two failure cases via set_extent_bit:
1) Return -EEXIST if exclusive bits are set
- Since it doesn't use any exclusive bits, this failure case can't
occur.
2) Return -ENOMEM if
btrfs_cleanup_fs_uuids, run_scheduled_bios, btrfs_close_extra_devices,
schedule_bio, and fill_device_from_item have no error conditions and
should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/volumes.c | 25 +
fs/btrfs/volumes.h |4 ++--
2
Hi all -
The following 23 patches add more error handling to the btrfs code:
- Add btrfs_panic
- Catch locking failures in {set,clear}_extent_bit
- Push up set_extent_bit errors to callers
- Push up lock_extent errors to callers
- Push up clear_extent_bit errors to callers
- Push up
run_ordered_completions, btrfs_stop_workers, btrfs_requeue_work, and
btrfs_queue_worker don't have any error conditions and should return
void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/async-thread.c | 31 ++-
fs/btrfs/async-thread.h |7 ---
btrfs_end_log_trans and wait_for_writer have no error conditions and should
return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/tree-log.c |6 ++
fs/btrfs/tree-log.h |2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
--- a/fs/btrfs/tree-log.c
+++
The *_state functions can only return 0 or -EEXIST. This patch addresses
the cases where those functions return -EEXIST, representing a locking
failure. It handles them by panicking with an appropriate error message.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c | 42
In submit_extent_page, there's a visually noisy if statement that, in
the midst of other conditions, does the tree dependency for tree-ops
and tree-ops-merge_bio_hook before calling it, and then another
condition afterwards. If an error is returned from merge_bio_hook,
there's no way to catch
As part of the effort to eliminate BUG_ON as an error handling
technique, we need to determine which errors are actual logic errors,
which are on-disk corruption, and which are normal runtime errors
e.g. -ENOMEM.
Annotating these error cases is helpful to understand and report them.
This
201 - 233 of 233 matches
Mail list logo