[PATCH] btrfs: print only if scanned device becomes part of the fs_devices

2014-05-29 Thread Anand Jain
justification: a deleted missing disk if reappears would end up with -EBUSY when it undergoes btrfs dev scan. But the sys log indicates bringing the disk back to the btrfs kernel was successful Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 23

[PATCH v2 3/4] Btrfs-progs: fsck: deal with corrupted csum root

2014-05-29 Thread Wang Shilong
If checksum root is corrupted, fsck will get segmentation. This is because if we fail to load checksum root, root's node is NULL which cause NULL pointer deferences later. To fix this problem, we just did something like extent tree rebuilding. Allocate a new one and clear uptodate flag. We will

[PATCH v2 1/4] Btrfs-progs: fsck: only allow partial opening under repair mode

2014-05-29 Thread Wang Shilong
The reason that we allow partial opening is that sometimes, we may have some corrupted trees.(for example extent tree), for fsck repair case, the broken tree may be rebuilt later. So if users only want to do check but not repair anything, this patch will make fsck return failure as soon as

[PATCH 3/3] Btrfs-progs: fsck: add tests for extent tree rebuilding

2014-05-29 Thread Wang Shilong
We need test to verify extent tree rebuilding work, this test create a strange filesystem with some snapshots, destroy extent root node, and run fsck with --init-extent-tree. Since this tests need btrfs internal tool(btrfs-corrupt-block),so i add this test into btrfs-progs. Signed-off-by: Wang

[PATCH 1/3] Btrfs-progs: fsck: finish transaction commit if repair error out

2014-05-29 Thread Wang Shilong
If btrfsck fail to repair, we hit something like following: Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0

[PATCH 2/3] Btrfs-progs: fsck: remove unfriendly BUG_ON() for searching tree failure

2014-05-29 Thread Wang Shilong
Now btrfsck would hit assertation failure for some searching tree failure. It is true that filesystem may get some metadata block corrupted, and btrfsck could not deal with these corruptings. But, Users really don't want a BUG_ON() here, Instead, just return errors to caller. Signed-off-by: Wang

Re: [PATCH RFC] btrfs: Add ctime/mtime update for btrfs device add/remove.

2014-05-29 Thread David Sterba
On Wed, Apr 16, 2014 at 05:02:32PM +0800, Qu Wenruo wrote: @@ -1704,10 +1720,14 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) ret = 0; - /* Notify udev that device has changed */ - if (bdev) + if (bdev) { + /* Notify udev that device

Re: [PATCH 4/4] btrfs: create sprout should rename fsid on the sysfs as well

2014-05-29 Thread David Sterba
On Mon, May 26, 2014 at 05:30:26PM +0800, Anand Jain wrote: --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2084,6 +2084,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) mutex_unlock(root-fs_info-fs_devices-device_list_mutex); if (seeding_dev)

Re: [PATCH 1/4] btrfs: dev delete should remove sysfs entry

2014-05-29 Thread David Sterba
On Mon, May 26, 2014 at 05:30:23PM +0800, Anand Jain wrote: --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -572,6 +572,26 @@ static void init_feature_attrs(void) } } +int rm_device_membership(struct btrfs_fs_info *fs_info, + struct btrfs_device *one_device) The name

Re: [PATCH 3/4] btrfs: dev replace should replace the sysfs entry

2014-05-29 Thread David Sterba
On Mon, May 26, 2014 at 05:30:25PM +0800, Anand Jain wrote: when we replace the device its corresponding sysfs entry has to be replaced as well Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/dev-replace.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff

Re: [PATCH 2/4] btrfs: dev add should add its sysfs entry

2014-05-29 Thread David Sterba
On Mon, May 26, 2014 at 05:30:24PM +0800, Anand Jain wrote: From: Anand Jain anand.j...@oracle.com we would need the device links to be created, when device is added. Looks good (plus the btrfs_ prefix mentioned before). Reviewed-by: David Sterba dste...@suse.cz I was comparing it to

btrfs-receive rename error

2014-05-29 Thread Rasmus Eskola
Hi, I'm trying to send an incremental backup of a btrfs subvolume to another host using the command: sudo btrfs send -v /home/backup/2014-05-29_02:26:38 | ssh root@s btrfs receive -v /btrfs/backup_bulky/home Eventually it stops with the following error: ERROR: rename o941570-199282-0 - failed.

[PATCH] Btrfs: fix transaction leak during fsync call

2014-05-29 Thread Filipe David Borba Manana
If btrfs_log_dentry_safe() returns an error, we set ret to 1 and fall through with the goal of committing the transaction. However, in the case where the inode doesn't need a full sync, we would call btrfs_wait_ordered_range() against the target range for our inode, and if it returned an error, we

[PATCH v2] Btrfs: fix transaction leak during fsync call

2014-05-29 Thread Filipe David Borba Manana
If btrfs_log_dentry_safe() returns an error, we set ret to 1 and fall through with the goal of committing the transaction. However, in the case where the inode doesn't need a full sync, we would call btrfs_wait_ordered_range() against the target range for our inode, and if it returned an error, we

Re: [PATCH RFC] btrfs: Add ctime/mtime update for btrfs device add/remove.

2014-05-29 Thread Qu Wenruo
Original Message Subject: Re: [PATCH RFC] btrfs: Add ctime/mtime update for btrfs device add/remove. From: David Sterba dste...@suse.cz To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2014年05月29日 20:43 On Wed, Apr 16, 2014 at 05:02:32PM +0800, Qu Wenruo wrote: @@ -1704,10

[PATCH v2] btrfs-progs: Add dev uuid output for print_dev_item().

2014-05-29 Thread Qu Wenruo
The original print_dev_item() only prints device id,total bytes and bytes used. When it comes to debug duplicated device id, dev uuid is needed to distinguish different devices since device id is not reliable. (Although the current dev replace implement will reuse the dev uuid, so not really