On Thu, Mar 22, 2012 at 01:25:26PM +0800, Miao Xie wrote:
> On Thu, 22 Mar 2012 15:39:36 +1100, Dave Chinner wrote:
> > On Thu, Mar 22, 2012 at 11:13:17AM +0800, Miao Xie wrote:
> >> The reason the deadlock is that:
> >> Task Btrfs-cleaner
> >> umount()
> >>
On Thu, 22 Mar 2012 03:41:09 +, Al Viro wrote:
> On Thu, Mar 22, 2012 at 11:13:15AM +0800, Miao Xie wrote:
>> Some file systems can do some works in the background by kthreads, we'd
>> better stop those works before we umount the file system, or it is easy to
>> introduce some problems. So we a
On Thu, 22 Mar 2012 15:39:36 +1100, Dave Chinner wrote:
> On Thu, Mar 22, 2012 at 11:13:17AM +0800, Miao Xie wrote:
>> The reason the deadlock is that:
>> Task Btrfs-cleaner
>> umount()
>> down_write(&s->s_umount)
>> close_ctree()
>> wait for
On Thu, Mar 22, 2012 at 11:13:17AM +0800, Miao Xie wrote:
> The reason the deadlock is that:
> TaskBtrfs-cleaner
> umount()
> down_write(&s->s_umount)
> close_ctree()
> wait for the end of
> btrfs-cleaner
>
On Thu, Mar 22, 2012 at 11:13:15AM +0800, Miao Xie wrote:
> Some file systems can do some works in the background by kthreads, we'd
> better stop those works before we umount the file system, or it is easy to
> introduce some problems. So we add an interface that is used to do some
> preparation fo
The reason the deadlock is that:
Task Btrfs-cleaner
umount()
down_write(&s->s_umount)
close_ctree()
wait for the end of
btrfs-cleaner
start_transaction
reserve
Some file systems can do some works in the background by kthreads, we'd
better stop those works before we umount the file system, or it is easy to
introduce some problems. So we add an interface that is used to do some
preparation for umount.
Signed-off-by: Miao Xie
---
fs/namespace.c |2
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 03/21/2012 09:56 PM, Liu Bo wrote:
> On 03/22/2012 09:11 AM, Jeff Mahoney wrote:
>> set_extent_bit can do exclusive locking but only when called by
>> lock_extent*,
>>
>> Drop the exclusive bits argument except when called by
>> lock_extent.
>>
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 03/21/2012 10:03 PM, Liu Bo wrote:
> On 03/22/2012 09:11 AM, Jeff Mahoney wrote:
>> There is only one caller of clear_extent_bit that checks the
>> return value and it only checks if it's negative. Since there are
>> no users of the returned bits fu
On 03/22/2012 09:11 AM, Jeff Mahoney wrote:
> There is only one caller of clear_extent_bit that checks the return value
> and it only checks if it's negative. Since there are no users of the
> returned bits functionality of clear_extent_bit, stop returning it
> and avoid complicating error handling
On 03/22/2012 09:11 AM, Jeff Mahoney wrote:
> set_extent_bit can do exclusive locking but only when called by lock_extent*,
>
> Drop the exclusive bits argument except when called by lock_extent.
>
Hi Jeff,
I have to say this is not a good cleanup, any benefits?
thanks,
liubo
> Signed-off-b
Unfortunately it isn't enough to just exit here - the kzalloc() happens in a
loop and the allocated items are added to a linked list whose head is passed
in from the caller.
To fix the BUG_ON() and also provide the semantic that the list passed in is
only modified on success, I create function-loc
__find_space_info can return NULL but we don't check it before calling
dump_space_info().
Signed-off-by: Jeff Mahoney
---
fs/btrfs/extent-tree.c |3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 37e0a80..c32a9bf 100
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
---
fs/btrfs/ordered-data.c | 12 ++--
fs/btrfs/relocation.c | 36
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 patch ad
balace_level() seems to deal with missing tree nodes by BUG_ON(). Instead,
we can easily just set the file system readonly and bubble -EROFS back up
the stack.
Signed-off-by: Mark Fasheh
---
fs/btrfs/ctree.c | 13 +++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fs
All callers of __finish_chunk_alloc() BUG_ON() return value, so it's trivial
for us to always bubble up any errors caught in __finish_chunk_alloc() to be
caught there.
Signed-off-by: Mark Fasheh
---
fs/btrfs/volumes.c | 10 ++
1 files changed, 6 insertions(+), 4 deletions(-)
diff --gi
set_extent_bit can do exclusive locking but only when called by lock_extent*,
Drop the exclusive bits argument except when called by lock_extent.
Signed-off-by: Jeff Mahoney
---
fs/btrfs/extent_io.c | 36 +++-
fs/btrfs/extent_io.h |2 +-
fs/btrfs/inode.c
__btrfs_cow_block(), the only caller of update_ref_for_cow() will BUG_ON()
any error return. Instead, we can go read-only fs as update_ref_for_cow()
manipulates disk data in a way which doesn't look like it's easily rolled
back.
Signed-off-by: Mark Fasheh
---
fs/btrfs/ctree.c |5 -
1 fi
The only caller of btrfs_alloc_dev_extent() is __btrfs_alloc_chunk() which
already bugs on any error returned. We can remove the BUG_ON's in
btrfs_alloc_dev_extent() then since __btrfs_alloc_chunk() will "catch" them
anyway.
Signed-off-by: Mark Fasheh
---
fs/btrfs/volumes.c |4 +++-
1 files
When a filesystem got aborted due do error, transaction_kthread() will
busyloop. Fix it by going to sleep in that case as well. Maybe we should
just stop transaction_kthread() when filesystem is aborted but that would be
more complex.
Signed-off-by: Jan Kara
---
fs/btrfs/disk-io.c |9 ++
Some images produced by btrfs-image cause a mount crash in rmap block
when excluding superblock extents. Handle the errors gracefully.
Signed-off-by: David Sterba
---
fs/btrfs/extent-tree.c | 19 ---
fs/btrfs/volumes.c | 20 +---
2 files changed, 33 insert
We BUG_ON() error from add_extent_mapping(), but that error looks pretty
easy to bubble back up - as far as I can tell there have not been any
permanent modifications to fs state at that point.
Signed-off-by: Mark Fasheh
---
fs/btrfs/volumes.c |3 ++-
1 files changed, 2 insertions(+), 1 dele
btrfs_alloc_chunk() unconditionally BUGs on any error returned from
__finish_chunk_alloc() so there's no need for two BUG_ON lines. Remove the
one from __finish_chunk_alloc().
Signed-off-by: Mark Fasheh
---
fs/btrfs/volumes.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --
btrfs currently handles most errors with BUG_ON. This patch is a work-in-
progress but aims to handle most errors other than internal logic
errors and ENOMEM more gracefully.
This iteration prevents most crashes but can run into lockups with
the page lock on occasion when the timing "works ou
With support for bigger metadata blocks, we must avoid mounting a
filesystem with different block size for mixed block groups, this causes
corruption (found by xfstests/083).
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c |8
1 files changed, 8 insertions(+), 0 deletions(-)
dif
Signed-off-by: Jeff Mahoney
---
fs/btrfs/ctree.h | 13 +++-
fs/btrfs/disk-io.c | 50 -
fs/btrfs/disk-io.h |4 +
fs/btrfs/relocation.c | 14 ++--
fs/btrfs/scrub.c |8 ++-
fs/btrfs/super.c | 74 +--
fs/btrfs/transaction.c | 190
Validate checksum algorithm during mount and prevent BUG_ON later in
btrfs_super_csum_size.
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c | 23 ++-
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 438993e..38
The only caller of update_ref_for_cow() is __btrfs_cow_block() which was
originally ignoring any return values. update_ref_for_cow() however doesn't
look like a candidate to become a void function - there are a few places
where errors can occur.
So instead I changed update_ref_for_cow() to bubble
update_ref_for_cow() will BUG_ON() after it's call to
btrfs_lookup_extent_info() if no existing references are found. Since refs
are computed directly from disk, this should be treated as a corruption
instead of a logic error.
Signed-off-by: Mark Fasheh
---
fs/btrfs/ctree.c |6 +-
1 fil
lock_extent and unlock_extent are always called with GFP_NOFS, drop the
argument and use GFP_NOFS consistently.
Signed-off-by: Jeff Mahoney
---
fs/btrfs/compression.c |6 +++---
fs/btrfs/disk-io.c |2 +-
fs/btrfs/extent_io.c| 41 +++--
The only error condition in clean_tree_block is an accounting bug.
Returning without modifying dirty_metadata_bytes and as if the cleaning
as been performed may cause problems later so it should panic instead.
It should probably be a BUG_ON but we have btrfs_panic now.
Signed-off-by: Jeff Mah
There is only one caller of clear_extent_bit that checks the return value
and it only checks if it's negative. Since there are no users of the
returned bits functionality of clear_extent_bit, stop returning it
and avoid complicating error handling.
Signed-off-by: Jeff Mahoney
---
fs/btrfs/extent
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
---
fs/btrfs/ctree.h |7 ---
fs/btrfs/root-tree.c |4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs
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
as
btrfs_insert_root is just a wrapper for btrfs_insert_item. Just return
the error directly.
Signed-off-by: Jeff Mahoney
---
fs/btrfs/root-tree.c |9 +++--
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index f409990..1fd93d6 1006
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
---
fs/btrfs/disk-io.c | 11 ++-
1 files changed, 6 insertions(
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
---
fs/btrfs/relocation.c | 22 --
1 files changed, 16 insertions(+), 6 d
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 it
This is called from only one place - create_subvol() which passes errors
safely back out to it's caller, btrfs_mksubvol where they are handled.
Additionally, btrfs_create_subvol_root() itself bug's needlessly from error
return of btrfs_update_inode(). Since create_subvol() was fixed to catch
error
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 in a
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 the er
The *_state functions can only return 0 or -EEXIST. This patch addresses
the cases where those functions returning -EEXIST represent a locking
failure. It handles them by panicking with an appropriate error message.
Signed-off-by: Jeff Mahoney
---
fs/btrfs/extent_io.c | 58
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.
Signed-off-b
This is the error handling patchset for btrfs.
The series is comprised of several groups of patches:
- Adding new btrfs_panic and btrfs_error routines
- Adding the ability to abort transactions
- Converting functions that don't have error conditions to
return void
- Eliminating the
On 03/22/2012 09:04 AM, Chris Samuel wrote:
> On 21/03/12 23:34, Andrea Gelmini wrote:
>
>> No comment, but I'm using this patches without problem since you
>> published it (compressed /home with hourly snapshot delete/creation).
>
> Well worth sending a Tested-By: tag then, it's useful informati
On 21/03/12 23:34, Andrea Gelmini wrote:
> No comment, but I'm using this patches without problem since you
> published it (compressed /home with hourly snapshot delete/creation).
Well worth sending a Tested-By: tag then, it's useful information.
cheers,
Chris
--
Chris Samuel : http://www.cs
read_tree_block() has the possibility of returning NULL.
So, the code in which it is checked whether the return value is
NULL is added.
Signed-off-by: Tsutomu Itoh
---
fs/btrfs/print-tree.c |1 +
fs/btrfs/relocation.c |2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/
Hallo, Ilya,
Du meintest am 21.03.12:
>>> I think this has been fixed in recent btrfs-progs, commit 32eff711.
>> It is fixed in some (or many) places, it is not fixed everywhere. I
>> had used kernel 3.2.9
> 32eff711 is supposed to fix it in more places, filesystem label and
> scrub status incl
On Wed, Mar 21, 2012 at 07:24:00PM +0100, Helmut Hullen wrote:
> Hallo, Ilya,
>
> Du meintest am 21.03.12:
>
> >> When I run
> >>
> >> btrfs filesystem label
> >>
> >> or
> >>
> >> btrfs scrub status /dev/sdxn
> >>
> >> then I get a lot of error messages with (p.e.)
> >>
> >> fa
Hallo, Ilya,
Du meintest am 21.03.12:
>> When I run
>>
>> btrfs filesystem label
>>
>> or
>>
>> btrfs scrub status /dev/sdxn
>>
>> then I get a lot of error messages with (p.e.)
>>
>> failed to read /dev/hda6: No such device or address
>> failed to read /dev/sdm7: No such devi
On Sat, Mar 17, 2012 at 10:32:00AM +0100, Helmut Hullen wrote:
> Hallo, linux-btrfs,
>
> some commands still look for non existent devices.
>
> I don't use "udev".
> When I run
>
> btrfs filesystem show
>
> only the existent devices are shown - fine.
>
> When I run
>
> btrfs f
2012/3/21 Liu Bo :
> Any comments?
No comment, but I'm using this patches without problem since you
published it (compressed
/home with hourly snapshot delete/creation).
Thanks a lot for your work,
Andrea
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a m
Hi Anand,
On 21.03.2012 05:03, Anand Jain wrote:
>
> Hi Team,
>
> Could you let me know if you are working on..
>
>Synchronous snapshot delete (or similar)
>
> few requested for this feature, just wanted
> to know if anyone has picked up this and is
> working on it.
I'm not working d
On 21 March 2012 00:16, Andrea Gelmini wrote:
> 2012/3/20 Daniel J Blueman :
>> mkfs.btrfs -m raid0 -d raid0 /dev/sdb1 /dev/sdc1
>> mount /dev/sdb1 /mnt
>> umount /mnt
>> mount /dev/sdb1 /mnt -o compress
>> umount /mnt
>> mount /dev/sdb1 /mnt -o ssd
>> umount /mnt
>> mount /dev/sdb1 /mnt -o discar
55 matches
Mail list logo