Re: Filesystem with Errors, Unusual behavior

2015-04-28 Thread Hugo Mills
On Mon, Apr 27, 2015 at 11:11:36PM -0700, Joshua Schmidlkofer wrote: > I have a large-ish filesystem, and it's starting to cause problems > after some SATA errors. > > After scrubs stalled, and reading of people with similar errors, I > downloaded the latest btrfs-progs and attempted a btrfsck - i

Re: help on broken file system

2015-04-28 Thread Anand Jain
I have a 3 disks file system configured in RAID1, created with Ubuntu :: > Having not a spare disk, and being the file system > a RAID1, I decided to use one of the 3 disks as target for the > restore. I formatted it in EXT4 and tried the restore. The process :: [liveuser@localhost ~]$ sudo

parent transid verify failed

2015-04-28 Thread Anthony Plack
I am running kernel 4.0 and btrfs-prog mainline. I have a backup. Of the following commands: btrfs check —repair device btrfsck —repair device mount -t btrfs -o recovery device mount && btrfs scrub start mount --none of them remove the "parent transid verify failed” errors from the disk. The d

Re: help on broken file system

2015-04-28 Thread Ermanno Baschiera
Thank you for your support, Duncan, and for your clear explanation about the concept of backup. I have very few data in that file system that I would miss if lost, because basically that file system serves as backup server and generic file storage. At the early stage of the incident, I was hoping t

Re: help on broken file system

2015-04-28 Thread Ermanno Baschiera
Thank you Anand, but, if I'm not wrong, the "delete device" has to be run against a mount point. But my file system can't be mounted. 2015-04-28 11:20 GMT+02:00 Anand Jain : > >> I have a 3 disks file system configured in RAID1, created with Ubuntu > > > :: > >> Having not a spare disk, and being

Re: Filesystem with Errors, Unusual behavior

2015-04-28 Thread Joshua Schmidlkofer
I'm now running ram tests today. After that, I can get the metadata dump and the debug command. Tonight, I will get you this info. Thank you for your help. Sincerely, Joshua -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kerne

Re: [PATCH 00/18] New extent-oriented qgroup mechanism with minor cleanup

2015-04-28 Thread Qu Wenruo
Original Message Subject: Re: [PATCH 00/18] New extent-oriented qgroup mechanism with minor cleanup From: Shilong Wang To: Qu Wenruo Date: 2015年04月21日 15:24 *Hi Qu, Look cleaner logic for me.^_^ Just two points from me.* 2015-04-21 14:21 GMT+08:00 Qu Wenruo mailto:quwe

[PATCH 00/18] New extent-oriented qgroup mechanism with minor cleanup

2015-04-28 Thread Qu Wenruo
[BRIEF] This patchset mainly introduces a new qgroup mechanism, which is originally used to fix a bug in fstest/btrfs/057. [WORKFLOW] The new mechanism works like the following: 0) Previous transaction is done. The new mechanism highly depends on commit_transaction. So without commit_transac

[PATCH v2 09/18] btrfs: qgroup: Add new function to record old_roots.

2015-04-28 Thread Qu Wenruo
Add function btrfs_qgroup_prepare_account_extents() to get old_roots which are needed for qgroup. We do it in commit_transaction() and before switch_roots(), and only search commit_root, so it gives a quite accurate view for previous transaction. With old_roots from previous transaction, we can u

[PATCH v2 16/18] btrfs: ulist: Add ulist_del() function.

2015-04-28 Thread Qu Wenruo
This function will delete unode with given (val,aux) pair. And with this patch, seqnum for debug usage doesn't have any meaning now, so remove them. This is used by later patches to skip snapshot root. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/ulist.c | 47 +++

[PATCH v2 08/18] btrfs: qgroup: Record possible quota-related extent for qgroup.

2015-04-28 Thread Qu Wenruo
Add hook in add_delayed_ref_head() to record quota-related extent record into delayed_ref_root->dirty_extent_record rb-tree for later qgroup accounting. Signed-off-by: Qu Wenruo --- v2: Skip extent_op qrecord allocation. Skip qrecord allocation for quota disabled case. --- fs/btrfs/delayed

[PATCH v2 05/18] btrfs: extent-tree: Use ref_node to replace unneeded parameters in __inc_extent_ref() and __free_extent()

2015-04-28 Thread Qu Wenruo
__btrfs_inc_extent_ref() and __btrfs_free_extent() have already had too many parameters, but three of them can be extracted from btrfs_delayed_ref_node struct. So use btrfs_delayed_ref_node struct as a single parameter to replace the bytenr/num_byte/no_quota parameters. The real objective of this

[PATCH v2 18/18] btrfs: qgroup: Make snapshot accounting work with new extent-oriented qgroup.

2015-04-28 Thread Qu Wenruo
Make snapshot accounting work with new extent-oriented mechanism by skipping given root in new/old_roots in create_pending_snapshot(). Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/transaction.c | 53 +++--- 1 file changed, 33 insertions(+), 20

[PATCH v2 15/18] btrfs: qgroup: Cleanup the old ref_node-oriented mechanism.

2015-04-28 Thread Qu Wenruo
Goodbye, the old mechanisim. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/ctree.h | 2 +- fs/btrfs/extent-tree.c | 5 - fs/btrfs/qgroup.c| 905 +-- fs/btrfs/qgroup.h| 49 --- include/trace/events/btrfs

[PATCH v2 14/18] btrfs: qgroup: Switch self test to extent-oriented qgroup mechanism.

2015-04-28 Thread Qu Wenruo
Since the self test transaction don't have delayed_ref_roots, so use find_all_roots() and export btrfs_qgroup_account_extent() to simulate it Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/qgroup.c | 2 +- fs/btrfs/qgroup.h | 5 ++ fs/btrfs/tests/qgroup-tests.c

[PATCH v2 17/18] btrfs: qgroup: Add the ability to skip given qgroup for old/new_roots.

2015-04-28 Thread Qu Wenruo
This is used by later qgroup fix patches for snapshot. As current snapshot accounting is done by btrfs_qgroup_inherit(), but new extent oriented quota mechanism will account extent from btrfs_copy_root() and other snapshot things, causing wrong result. So add this ability to handle snapshot accou

[PATCH v2 13/18] btrfs: qgroup: Switch to new extent-oriented qgroup mechanism.

2015-04-28 Thread Qu Wenruo
Switch from old ref_node based qgroup to extent based qgroup mechanism for normal operations. The new mechanism should hugely reduce the overhead of btrfs quota system, and further more, the codes and logic should be more clean and easier to maintain. Signed-off-by: Qu Wenruo --- v2: None ---

[PATCH v2 06/18] btrfs: qgroup: Add function qgroup_update_refcnt().

2015-04-28 Thread Qu Wenruo
This function is used to update refcnt for qgroups. And is one of the two core functions used in the new qgroup implement. This is based on the old update_old/new_refcnt, but provides a unified logic and behavior. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/qgroup.c | 58 ++

[PATCH v2 11/18] btrfs: qgroup: Add new qgroup calculation function btrfs_qgroup_account_extents().

2015-04-28 Thread Qu Wenruo
The new btrfs_qgroup_account_extents() function should be called in btrfs_commit_transaction() and it will update all the qgroup according to delayed_ref_root->dirty_extent_root. The new function can handle both normal operation during commit_transaction() or in rescan in a unified method with cle

[PATCH v2 12/18] btrfs: qgroup: Switch rescan to new mechanism.

2015-04-28 Thread Qu Wenruo
Switch rescan to use the new new extent oriented mechanism. As rescan is also based on extent, new mechanism is just a perfect match for rescan. With re-designed internal functions, rescan is quite easy, just call btrfs_find_all_roots() and then btrfs_qgroup_account_one_extent(). Signed-off-by:

[PATCH v2 02/18] btrfs: delayed-ref: Use list to replace the ref_root in ref_head.

2015-04-28 Thread Qu Wenruo
This patch replace the rbtree used in ref_head to list. This has the following advantage: 1) Easier merge logic. With the new list implement, we only need to care merging the tail ref_node with the new ref_node. And this can be done quite easy at insert time, no need to do a indicated merge at run_

[PATCH v2 04/18] btrfs: qgroup: Cleanup open-coded old/new_refcnt update and read.

2015-04-28 Thread Qu Wenruo
Use inline functions to do such things, to improve readability. Signed-off-by: Qu Wenruo Acked-by: David Sterba --- v2: None --- fs/btrfs/qgroup.c | 95 +++ 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/fs/btrfs/qgroup.c b/

[PATCH v2 10/18] btrfs: backref: Add special time_seq == (u64)-1 case for btrfs_find_all_roots().

2015-04-28 Thread Qu Wenruo
Allow btrfs_find_all_roots() to skip all delayed_ref_head lock and tree lock to do tree search. This is important for later qgroup implement which will call find_all_roots() after fs trees are committed. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/backref.c | 35 +++

[PATCH v2 07/18] btrfs: qgroup: Add function qgroup_update_counters().

2015-04-28 Thread Qu Wenruo
Add function qgroup_update_counters(), which will update related qgroups' rfer/excl according to old/new_roots. This is one of the two core functions for the new qgroup implement. This is based on btrfs_adjust_coutners() but with clearer logic and comment. Signed-off-by: Qu Wenruo --- v2: Non

[PATCH v2 03/18] btrfs: delayed-ref: Cleanup the unneeded functions.

2015-04-28 Thread Qu Wenruo
Cleanup the rb_tree merge/insert/update functions, since now we use list instead of rb_tree now. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/delayed-ref.c | 174 - 1 file changed, 174 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/

[PATCH v2 01/18] btrfs: backref: Don't merge refs which are not for same block.

2015-04-28 Thread Qu Wenruo
Old __merge_refs() in backref.c will even merge refs whose root_id are different, which makes qgroup gives wrong result. Fix it by checking ref_for_same_block() before any mode specific works. Signed-off-by: Qu Wenruo --- v2: None --- fs/btrfs/backref.c | 6 +++--- 1 file changed, 3 insertio