Josef Bacik wrote:
In fixing how we deal with bad inodes, we had a regression in the orphan
cleanup
code, since it expects to get a bad inode back. So fix it to deal with
getting
-ESTALE back by deleting the orphan item manually and moving on. Thanks,
Reported-by: Simon Kirby
On Mon, Oct 3, 2011 at 8:07 PM, Avi Kivity avi.kiv...@gmail.com wrote:
Thats -EIO, is there any messages before the bug? Thanks,
Not that I recall. I'll check again when I'm near the poor thing again.
Confirmed - that's the first relevant message.
As to -EIO, I dd'ed the entire volume
I noticed while running xfstests 83 that if we didn't have enough space to
delete our inode the orphan cleanup would just loop. This is because it keeps
finding the same orphan item and keeps trying to kill it but can't because we
don't get an error back from iput for deleting the inode. So keep
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 | 41
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_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
+++
btrfs_prepare_extent_commit has no error conditions and should return
void. Its callers already ignore the error codes anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |4 ++--
fs/btrfs/extent-tree.c |3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
btrfs_run_defrag_inodes has no error conditions and should return
void. Its callers already ignore the error codes anyway.
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(-)
---
This patch pushes kmalloc errors up to the caller and BUGs in the caller.
The BUG_ON for duplicate reloc tree root insertion is replaced with a
panic explaining the issue.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/relocation.c | 20 +++-
1 file changed, 15
btrfs_destroy_delalloc_inodes has no error conditions and should return
void. Its callers already ignore the error codes anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/disk-io.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/fs/btrfs/disk-io.c
+++
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 @@
Now that process_func can't return an error, __btrfs_mod_ref has no more
error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 30 ++
fs/btrfs/ctree.h |8
fs/btrfs/extent-tree.c | 34
btrfs_extend_item has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c |7 +++
fs/btrfs/ctree.h |5 +++--
fs/btrfs/dir-item.c|5 ++---
fs/btrfs/extent-tree.c |5 ++---
fs/btrfs/file-item.c |2 +-
end_compressed_writeback has no error conditions and should return
void. Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/compression.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/compression.c
+++
copy_for_split has no error conditions and should return void. We
return 0 from split_leaf instead of ret since ret would have been
set using the return value from copy_for_split which would have been 0.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 19
clean_tree_block has no error conditions and should return void. Its
callers already ignore the error codes.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/disk-io.c |5 ++---
fs/btrfs/disk-io.h |4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
---
Now that btrfs_truncate_item returns void, there are no more error
conditions in update_inline_extent_backref and it should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent-tree.c | 23 +++
1 file changed, 11 insertions(+), 12 deletions(-)
---
btrfs_truncate_item has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 11 +--
fs/btrfs/ctree.h |8
fs/btrfs/dir-item.c|4 ++--
fs/btrfs/extent-tree.c |3 +--
fs/btrfs/file-item.c |
btrfs_free_extent has no error conditions, but is used via process_func
in __btrfs_mod_ref which requires it to return an int.
This patch cleans up the callers to eliminate error handling that will
never be used. The next patch makes both btrfs_free_extent and the other
function used via
btrfs_insert_root is just a wrapper for btrfs_insert_item. Just return
the error directly.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/root-tree.c |9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -116,13
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
__setup_root has no error conditions and should return void. Its callers
already ignore the error codes anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/disk-io.c |9 -
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
__btrfs_mod_ref's process_func function pointer calls btrfs_free_extent
and btrfs_inc_extent_ref, which now both return only 0. This patches
makes them return void and eliminates the error condition in
__btrfs_mod_ref.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |
Now that the delayed ref code uses mempools, allocations can't fail,
and there are no more error conditions to report.
This patch makes the following functions return void:
- btrfs_alloc_reserved_file_extent
- btrfs_add_delayed_tree_ref
- btrfs_add_delayed_data_ref
-
This patch converts the delayed ref code to use slab cache-backed mempools
for allocating its nodes.
The allocations happen deep in the call path where error recovery is
impossible.
By using mempools, we ensure that the allocations can't fail. Each
mempool keeps a page of structures
add_delayed_data_ref has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/delayed-ref.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -520,11 +520,11 @@
Correctness fix: The kfree calls in the add_delayed_* functions free
the node that's passed into it, but the node is a member of another
structure. It works because it's always the first member of the
containing structure, but it should really be using the containing
structure itself.
With fixup_low_keys now returning void, there are no error conditions
for del_ptr to report so it should return void. We set ret = 0 explicitly
in btrfs_del_items but I'm not convinced that the error handling code
already there is correct.
Signed-off-by: Jeff Mahoney je...@suse.com
---
insert_ptr has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 46 +-
1 file changed, 13 insertions(+), 33 deletions(-)
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2114,12 +2114,11
setup_items_for_insert now has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 26 ++
fs/btrfs/ctree.h |8
fs/btrfs/delayed-inode.c |6 ++
3 files changed, 16
add_delayed_ref_head has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/delayed-ref.c | 29 ++---
1 file changed, 10 insertions(+), 19 deletions(-)
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@
fixup_low_keys has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.c | 39 +++
1 file changed, 11 insertions(+), 28 deletions(-)
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1864,15 +1864,12 @@
add_delayed_tree_ref has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/delayed-ref.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -467,10 +467,10 @@
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
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_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
btrfs_set_block_group_rw has no error conditions and should return
void. Its callers already ignore the error codes anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ctree.h |4 ++--
fs/btrfs/extent-tree.c |3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
setup_inline_extent_backref has no error conditions and should return
void. We set ret = 0 explicitly in insert_inline_extent_backref since
it would have been set using the return value, which would have been 0.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent-tree.c | 23
wait_for_writer has no error conditions and should return void. Its
callers already ignore the error codes anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/tree-log.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/tree-log.c
+++
btrfs_requeue_work has no error conditions and should return void.
Its callers ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/async-thread.c |7 ++-
fs/btrfs/async-thread.h |2 +-
2 files changed, 3 insertions(+), 6 deletions(-)
---
run_ordered_completions has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/async-thread.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/async-thread.c
+++
btrfs_stop_workers has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/async-thread.c |3 +--
fs/btrfs/async-thread.h |2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
---
schedule_bio has no error conditions and should return void. Its callers
already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/volumes.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@
btrfs_queue_worker has no error conditions and should return void.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/async-thread.c | 14 --
fs/btrfs/async-thread.h |2 +-
2 files changed, 5 insertions(+), 11 deletions(-)
--- a/fs/btrfs/async-thread.c
+++
btrfs_cleanup_fs_uuids has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/volumes.c |3 +--
fs/btrfs/volumes.h |2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
---
run_scheduled_bios has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/volumes.c |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
clear_extent_buffer_dirty has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |3 +--
fs/btrfs/extent_io.h |2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
---
check_page_writeback has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/extent_io.c
+++
check_page_uptodate has no error conditions and should return void. Its
callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/fs/btrfs/extent_io.c
+++
check_page_locked has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/fs/btrfs/extent_io.c
+++
wait_extent_bit has no error conditions and should return void. Its
callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |3 +--
fs/btrfs/extent_io.h |2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
---
__unlock_for_delalloc has no error conditions and should return void.
Its callers already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |9 -
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/fs/btrfs/extent_io.c
+++
wait_on_state has no error conditions and should return void. Its callers
already ignore the error code anyway.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/btrfs/extent_io.c
+++
set_range_writeback has no error conditions and should return void.
Its callers already ignore the error code anyway.
There are internal error conditions but they are fatal and will cause
a panic.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/extent_io.c |8 +---
1 file
btrfs_update_root BUG's when it can't alloc a path, yet it can recover
from a search error. This patch returns -ENOMEM instead.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/root-tree.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/btrfs/root-tree.c
+++
find_and_setup_root BUGs when it encounters an error from
btrfs_find_last_root, which can occur if a path can't be allocated.
This patch pushes it up to its callers where it is already handled.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/disk-io.c |3 ++-
1 file changed, 2
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
---
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 ++--
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.
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.
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 ordered data and relocation trees have BUG_ONs to protect against
bad tree operations.
This patch replaces them with a panic that will report the problem.
Signed-off-by: Jeff Mahoney je...@suse.com
---
fs/btrfs/ordered-data.c | 12 ++--
fs/btrfs/relocation.c | 36
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
On Tue, Oct 4, 2011 at 4:39 PM, Avi Kivity avi.kiv...@gmail.com wrote:
On Mon, Oct 3, 2011 at 8:07 PM, Avi Kivity avi.kiv...@gmail.com wrote:
Thats -EIO, is there any messages before the bug? Thanks,
Not that I recall. I'll check again when I'm near the poor thing again.
Confirmed -
On 10/04/2011 03:50 PM, Avi Kivity wrote:
Yup I would love to investigate this, what kind of snapshot?
LVM snapshot.
Did you dd
the drive or soemthing? Let me know where to pull it down.
Um, it's my /home. It's not leaving home. But if you have test
kernels or btrfscks you want to
On Tue, Oct 4, 2011 at 10:01 PM, Josef Bacik jo...@redhat.com wrote:
On 10/04/2011 03:50 PM, Avi Kivity wrote:
Yup I would love to investigate this, what kind of snapshot?
LVM snapshot.
Did you dd
the drive or soemthing? Let me know where to pull it down.
Um, it's my /home. It's not
That 2 week time line has now reached the 9 week mark. The only
update anyone has seen was 7 weeks ago, with a 'maybe today'.
Isn't it time to get that code checked in so someone else can take
over, and not have to start from scratch? Even if there isn't any
actual working code, having any
Signed-off-by: David Sterba dste...@suse.cz
---
fs/btrfs/Kconfig | 10 ++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index ecb9fd3..5601066 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -31,3 +31,13 @@ config
68 matches
Mail list logo