[PATCH v3 1/2] btrfs: remove empty fs_devices to prevent memory runout

2015-01-18 Thread Gui Hecheng
, then it is asured that the devices in cloned @fs_devices are not treated as valid devices. o If a device disappears and reappears without any touch, its @bdev-bd_dev may change, so we have to re-insert it into the rb_root. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changelog v1-v2

Re: [PATCH v2 1/2 RESEND] btrfs: remove empty fs_devices to prevent memory runout

2015-01-18 Thread Gui Hecheng
Oh, sorry, some format style problems... let me resend a new one. On Thu, 2015-01-15 at 16:53 +0800, Gui Hecheng wrote: There is a global list @fs_uuids to keep @fs_devices object for each created btrfs. But when a btrfs becomes empty (all devices belong to it are gone), its @fs_devices

[PATCH v2 1/2 RESEND] btrfs: remove empty fs_devices to prevent memory runout

2015-01-15 Thread Gui Hecheng
, then it is asured that the devices in cloned @fs_devices are not treated as valid devices. o If a device disappears and reappears without any touch, its @bdev-bd_dev may change, so we have to re-insert it into the rb_root. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changelog v1-v2

[PATCH 2/2 RESEND] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices

2015-01-15 Thread Gui Hecheng
with is that a block device is unplugged and replugged, then it appears with a new @bdev-bd_dev as devnum. In this case, we should remove the older since we should have a new one for that block device already. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- fs/btrfs/super.c | 10

Re: [PATCH] btrfs: cleanup a straight free-after-malloc branch for free-space-cache

2015-01-14 Thread Gui Hecheng
On Wed, 2015-01-14 at 16:22 +0100, David Sterba wrote: On Wed, Jan 14, 2015 at 04:18:54PM +0800, Gui Hecheng wrote: Move the branch that is unrelated to the result of io_ctl_init() before the function call, so we can save a kmalloc() kfree() pair in that branch. Signed-off-by: Gui

[PATCH] btrfs: fix raid56 scrub failed in xfstests btrfs/072

2015-01-08 Thread Gui Hecheng
The xfstests btrfs/072 reports uncorrectable read errors in dmesg, because scrub forgets to use commit_root for parity scrub routine and scrub attempts to scrub those extents items whose contents are not fully on disk. To fix it, we just add the @search_commit_root flag back. Signed-off-by: Gui

Re: [PATCH] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices

2015-01-07 Thread Gui Hecheng
[ping] On Wed, 2014-12-10 at 15:39 +0800, Gui Hecheng wrote: The following patch: btrfs: remove empty fs_devices to prevent memory runout introduces @valid_dev_root aiming at recording @btrfs_device objects that have corresponding block devices with btrfs. But if a block device

Re: [PATCH v3] btrfs-progs: Documentation: add T/P/E description for resize cmd

2015-01-04 Thread Gui Hecheng
On Fri, 2015-01-02 at 17:21 +0100, David Sterba wrote: On Fri, Jan 02, 2015 at 05:12:04PM +0100, David Sterba wrote: On Thu, Jan 01, 2015 at 08:27:55PM -0700, Chris Murphy wrote: Small problem with the rendering of this commit d4ef1a06f8be623ae94e4d498c306e8dd1605bef, when I use 'man

[PATCH] btrfs: cleanup init for list in free-space-cache

2014-12-30 Thread Gui Hecheng
o removed an unecessary INIT_LIST_HEAD after LIST_HEAD o merge a declare INIT_LIST_HEAD pair into one LIST_HEAD Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- fs/btrfs/free-space-cache.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/btrfs/free-space

Re: [PATCH v2] btrfs-progs: Documentation: add T/P/E description for resize cmd

2014-12-29 Thread Gui Hecheng
On Mon, 2014-12-29 at 17:07 +0100, David Sterba wrote: On Mon, Dec 22, 2014 at 03:22:53PM +0800, Gui Hecheng wrote: Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- changelog v1-v2: s/\'E\'(EiB)/or \'E\'(EiB

[PATCH v3] btrfs-progs: Documentation: add T/P/E description for resize cmd

2014-12-29 Thread Gui Hecheng
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- changelog v1-v2: s/\'E\'(EiB)/or \'E\'(EiB)/ as suggested by Satoru, thanks. v2-v3: replace confusing format 'K'(KiB) etc. Thanks

[PATCH 1/2] btrfs-progs: move check_arg_type() to util.c

2014-12-24 Thread Gui Hecheng
The check_arg_type() function does quite generic thing, move it to utils.c. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-filesystem.c | 32 utils.c | 32 utils.h | 1 + 3 files changed, 33

Re: [PATCH 2/2] btrfs-progs: refine btrfs-debug-tree error prompt when a mount point given

2014-12-24 Thread Gui Hecheng
On Thu, 2014-12-25 at 15:49 +0900, Satoru Takeuchi wrote: On 2014/12/25 10:16, Gui Hecheng wrote: Now, if exec: # btrfs-debug-tree mount_point it echos: : Superblock bytenr is larger than device size But it is quite misleading, because it is a valid btrfs. In this case, we

Re: [PATCH] btrfs-progs: Fix btrfs fi show by uuid and label

2014-12-23 Thread Gui Hecheng
; - } - - search = path; + if (realpath(search, path)) + search = path; This looks nice and stay consistent with the behavior before my faulty commit. Reviewed-by: Gui Hecheng guihc.f...@cn.fujitsu.com Thanks, Gui /* * Needs special

Re: [PATCH 1/2] Remove unnecessary placeholder in btrfs_err_code

2014-12-22 Thread Gui Hecheng
On Mon, 2014-12-22 at 19:39 +0900, Satoru Takeuchi wrote: Sorry, I forgot to add Signed-off-by line. --- From: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com notused is not necessary. Set 1 to the first entry is enough. Hi Satoru, Actually, the struct is copied from the kernel header

[PATCH] btrfs-progs: Documentation: add T/P/E description for resize cmd

2014-12-21 Thread Gui Hecheng
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- Documentation/btrfs-filesystem.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/btrfs-filesystem.txt b/Documentation/btrfs-filesystem.txt index a8f2972..f2bd50d 100644 --- a/Documentation/btrfs

[PATCH v2] btrfs-progs: Documentation: add T/P/E description for resize cmd

2014-12-21 Thread Gui Hecheng
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- changelog v1-v2: s/\'E\'(EiB)/or \'E\'(EiB)/ as suggested by Satoru, thanks. --- Documentation/btrfs-filesystem.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH v2] Fix wrong memory free on check_is_root

2014-12-18 Thread Gui Hecheng
na...@elisp.net Looks good to me. Reviewed-by: Gui Hecheng guihc.f...@cn.fujitsu.com Thanks, Gui --- changelog v2: Return a correct error code when realpath() fails. Thank you Gui Hecheng for pointing my mistake out. https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg40204

[PATCH] btrfs-progs: remove uneccessary subvol name check for subvol deletion

2014-12-17 Thread Gui Hecheng
When we want to delete a subvol, we first check to see whether it is a subvolume or not. After the check, we are sure that it is a valid subvol, don't have to check its name. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-subvolume.c | 15 --- 1 file changed, 15

Re: [PATCH 1/2] Fix wrong memory free on check_is_root

2014-12-17 Thread Gui Hecheng
On Thu, 2014-12-18 at 15:09 +0900, Satoru Takeuchi wrote: From: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com Date: Thu, 18 Dec 2014 14:35:22 +0900 @tmp is freed even if its allocation fails. Signed-off-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- cmds-property.c | 13

Re: [PATCH 2/2] btrfs-progs: fix the file system root is regarded as non-root

2014-12-17 Thread Gui Hecheng
On Thu, 2014-12-18 at 15:42 +0900, Satoru Takeuchi wrote: From: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com When / is Btrfs, btrfs property subcommand / regards it as non-root by mistake. check_is_root() regards @object as a file system root if the following two conditions are

[PATCH] btrfs: introduce shrinker for rb_tree that keeps valid btrfs_devices

2014-12-09 Thread Gui Hecheng
with is that a block device is unplugged and replugged, then it appears with a new @bdev-bd_dev as devnum. In this case, we should remove the older since we should have a new one for that block device already. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- fs/btrfs/super.c | 10

Re: btrfs fi show not accepting mount path as arg?

2014-12-04 Thread Gui Hecheng
On Thu, 2014-12-04 at 19:20 +0530, Shriramana Sharma wrote: Using SuSE Tumbleweed. Observe: [samjnaa:~] sudo btrfs fi show root's password: Label: 'BRIHATII' uuid: 57836428-576e-466b-8a28-7961712867ab Total devices 1 FS bytes used 460.19GiB devid1 size 931.51GiB used

[PATCH v2] btrfs: remove empty fs_devices to prevent memory runout

2014-11-30 Thread Gui Hecheng
, then it is asured that the devices in cloned @fs_devices are not treated as valid devices. o If a device disappears and reappears without any touch, its @bdev-bd_dev may change, so we have to re-insert it into the rb_root. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changelog v1-v2

[PATCH] btrfs-progs: fix return value problem for btrfs sub show

2014-11-26 Thread Gui Hecheng
) fixed another code branch which may return 0 upon error. 3) with 2) applied, the ret = 0 follows can be removed Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-subvolume.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index

[PATCH] btrfs-progs: apply realpath for btrfs fi show when mount point is given

2014-11-26 Thread Gui Hecheng
For now, # btrfs fi show /mnt/btrfs gives info correctly, while # btrfs fi show /mnt/btrfs/ gives nothing. This implies that the @realpath() function should be applied to unify the behavior. Made a more clear comment right above the call as well. Signed-off-by: Gui Hecheng

Re: [PATCH v4] btrfs-progs: fix page align issue for lzo compress in restore

2014-11-26 Thread Gui Hecheng
On Tue, 2014-10-14 at 11:32 +0200, David Sterba wrote: On Tue, Oct 14, 2014 at 10:06:16AM +0200, Marc Dietrich wrote: This hasn't landed in an btrfs-progs branch I found. Any update? I had it tagged for review and found something that needs fixing. The PAGE_CACHE_SIZE is hardcoded to 4k,

[PATCH 1/2] btrfs-progs: remove dead condition for btrfs_map_block

2014-11-25 Thread Gui Hecheng
The @search_cache_extent() only returns the next cache_extent or NULL, it will never return the previous cache_extent. So just remove the dead condition for previous cache_extent handle. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- volumes.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] btrfs-progs: convert: fix unable to rollback case with removed empty block groups

2014-11-25 Thread Gui Hecheng
of space of the gap belongs to a removed empty block group, and rollback should detect this case, and feel free to continue. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- btrfs-convert.c | 13 +++-- volumes.c | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff

Re: File test operator for subvols; possible bug in 'btrfs show directory'

2014-11-24 Thread Gui Hecheng
On Tue, 2014-11-25 at 02:11 +, boris wrote: Hi all, I was looking for a quick method of testing whether a working directory is a subvolume. Couldn't see an obvious one, so tried 'btrfs show somesubvol≥'. It printed a fail message as expected but returned 0 exit status. Bug? Hi

Re: [PATCH] btrfs: remove empty fs_devices to prevent memory runout

2014-11-23 Thread Gui Hecheng
10:15 AM, Gui Hecheng wrote: There is a global list @fs_uuids to keep @fs_devices object for each created btrfs. But when a btrfs becomes empty (all devices belong to it are gone), its @fs_devices remains in @fs_uuids list until module exit. If we keeps mkfs.btrfs on the same device again

[PATCH] btrfs: remove empty fs_devices to prevent memory runout

2014-11-19 Thread Gui Hecheng
@fs_devices are not treated as valid devices. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- fs/btrfs/super.c | 1 + fs/btrfs/volumes.c | 181 - fs/btrfs/volumes.h | 6 ++ 3 files changed, 172 insertions(+), 16 deletions(-) diff

[PATCH v2 2/2] btrfs-progs: fix wrong num_devices for btrfs fi show with seed devices

2014-11-12 Thread Gui Hecheng
The @fi_args-num_devices in @get_fs_info() does not include seed devices. We could just correct it by searching the chunk tree and count how many dev_items there are in total which includes seed devices. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changelog v1-v2: adopt more

[PATCH] btrfs-progs: use canonical name for device in btrfs fi show when mounted

2014-11-12 Thread Gui Hecheng
used SIZE path /dev/dm-5 + devid DEVID size SIZE used SIZE path /dev/dm-6 The /dev/dm-* points to lvm volumes, use @canonicalize_path() to convert them and we will make it through. Of course we should do the same thing for dev stat. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com

[PATCH v3] btrfs-progs: skip fs with no seed when build seed/sprout mapping for fi show

2014-11-10 Thread Gui Hecheng
-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changlog v1-v2: adopt more natural function name: no_seed_devices == has_seed_devices v2-v3: skip such fs after copied, otherwise such fs won't be shown --- cmds-filesystem.c | 25 +++-- 1 file changed

[PATCH] btrfs: fix dead lock while running replace and defrag concurrently

2014-11-09 Thread Gui Hecheng
have to check it before write. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- fs/btrfs/scrub.c | 90 +--- 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index efa0831..4325bb0

Re: [PATCH 2/2] btrfs-progs: fix wrong num_devices for btrfs fi show with seed devices

2014-11-09 Thread Gui Hecheng
On Sat, 2014-11-08 at 19:47 +, Mike Fleetwood wrote: On 7 November 2014 18:16, David Sterba dste...@suse.cz wrote: On Fri, Nov 07, 2014 at 10:07:43AM +0800, Gui Hecheng wrote: The @fi_args-num_devices in @get_fs_info() does not include seed devices. We could just correct it by searching

[PATCH v2] btrfs-progs: skip fs with no seed when build seed/sprout mapping for fi show

2014-11-09 Thread Gui Hecheng
-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changlog v1-v2: adopt more natural function name: no_seed_devices == has_seed_devices --- cmds-filesystem.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds

[PATCH] btrfs-progs: skip fs with no seed when build seed/sprout mapping for fi show

2014-11-06 Thread Gui Hecheng
-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-filesystem.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 67fe52b..0d49cd1 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -795,6 +795,22 @@ out

[PATCH 2/2] btrfs-progs: fix wrong num_devices for btrfs fi show with seed devices

2014-11-06 Thread Gui Hecheng
The @fi_args-num_devices in @get_fs_info() does not include seed devices. We could just correct it by searching the chunk tree and count how many dev_items there are in total which includes seed devices. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- *Note* This is just a temporary

[PATCH 1/2] btrfs-progs: remove BUG_ON on num of devices for btrfs fi show

2014-11-06 Thread Gui Hecheng
The following BUG_ON: BUG_ON(ndevs = fi_args-num_devices) is not needed, because it always fails with seed devices present. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/utils.c b/utils.c index f10c178..9bcc1a0 100644

Re: read block failed check_tree_block / Couldn't read chunk tree

2014-10-30 Thread Gui Hecheng
On Wed, 2014-10-29 at 11:45 +0800, Anand Jain wrote: this is (most likely) due to patch below, commit 915902c5002485fb13d27c4b699a73fb66cc0f09 btrfs-progs: fix device missing of btrfs fi show with seed devices Could you try to back out the patch

Re: [PATCH] btrfs-progs: fix dev stats error output related to replace handle

2014-10-29 Thread Gui Hecheng
probe for _transient_ replacing device Try it out. Lets know. Thanks Oh, yes, I've tried your revert patch and I acknowledge that it fixes the problem. So please *ignore* my patch David, sorry for the noise. -Gui On 10/23/14 09:56, Gui Hecheng wrote: Steps to reproduce

Re: [PATCH] revert btrfs-progs: do a separate probe for _transient_ replacing device

2014-10-29 Thread Gui Hecheng
On Wed, 2014-10-29 at 18:51 +0800, Anand Jain wrote: There is a compatibility issue with older kernel with the progs commit id as below. 05cd2907557ba627cfb86e60b214ea6228613a84 Which tree does this commit id belongs to? I can't find it anywhere? So as of now writing to revert the above

[PATCH 1/2] btrfs-progs: make the search target device routine more clear for fi show

2014-10-29 Thread Gui Hecheng
Extract the procedure of searching for a target device for fi show from the @map_seed_devices() function to make it more clear. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-filesystem.c | 37 - 1 file changed, 28 insertions(+), 9 deletions

[PATCH 2/2] btrfs-progs: skip mounted fs when deal with umounted ones for fi show

2014-10-29 Thread Gui Hecheng
@btrfs_can_kernel() has finished showing all mounted ones. We could skip the mounted fs after @btrfs_can_kernel() is done, then tasks keeps going on mounted fs while fi show continues on umounted ones separately. Reported-by: Petr Janecek jane...@ucw.cz Signed-off-by: Gui Hecheng guihc.f

Re: Btrfs-progs release 3.17

2014-10-28 Thread Gui Hecheng
On Tue, 2014-10-28 at 16:42 +0800, Anand Jain wrote: On 28/10/2014 12:03, Gui Hecheng wrote: On Thu, 2014-10-23 at 21:36 +0800, Anand Jain wrote: there is no point in re-creating so many btrfs kernel's logic in user space. its just unnecessary, when kernel is already doing

Re: Btrfs-progs release 3.17

2014-10-27 Thread Gui Hecheng
On Thu, 2014-10-23 at 15:23 +0200, Petr Janecek wrote: Hello Gui, Oh, it seems that there are btrfs with missing devs that are bringing troubles to the @open_ctree_... function. what do you mean by missing devs? I have no degraded fs. Ah, sorry, I'm too focused on the problem that

Re: Btrfs-progs release 3.17

2014-10-27 Thread Gui Hecheng
the seed/sprout relationships so that we can fetch them correctly for umounted btrfs? -Gui On 10/23/14 16:52, Gui Hecheng wrote: On Thu, 2014-10-23 at 16:13 +0800, Anand Jain wrote: Some of the disks on my system were missing and I was able to hit this issue. Check

Re: Btrfs-progs release 3.17

2014-10-23 Thread Gui Hecheng
On Thu, 2014-10-23 at 16:13 +0800, Anand Jain wrote: Some of the disks on my system were missing and I was able to hit this issue. Check tree block failed, want=12582912, have=0 read block failed check_tree_block Couldn't read chunk root warning devid 2 not found

[PATCH] btrfs-progs: fix dev stats error output related to replace handle

2014-10-22 Thread Gui Hecheng
with device under replacing. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- utils.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index f10c178..0ba2b26 100644 --- a/utils.c +++ b/utils.c @@ -1881,12 +1881,15 @@ int get_fs_info(char *path

Re: [PATCH] btrfs: fix wrong pad for kernelspace arg of btrfs dev stat

2014-10-16 Thread Gui Hecheng
On Thu, 2014-10-16 at 11:26 +0200, Stefan Behrens wrote: On Thu, 16 Oct 2014 09:53:37 +0800, Gui Hecheng wrote: The @btrfs_ioctl_get_dev_stats fails to pad to 1k as descripted, actually it valuates to 1032 bytes. The corresponding userspace change follows this change. Signed-off

Re: [PATCH v2] btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots

2014-10-16 Thread Gui Hecheng
On Thu, 2014-09-04 at 20:02 +0800, Anand Jain wrote: On 09/04/2014 05:58 PM, David Sterba wrote: On Mon, Aug 18, 2014 at 04:38:18PM +0800, Anand Jain wrote: ioctl BTRFS_IOC_FS_INFO return num_devices which does _not_ include seed device, But the following ioctl BTRFS_IOC_DEV_INFO counts

[PATCH] btrfs: fix wrong pad for kernelspace arg of btrfs dev stat

2014-10-15 Thread Gui Hecheng
The @btrfs_ioctl_get_dev_stats fails to pad to 1k as descripted, actually it valuates to 1032 bytes. The corresponding userspace change follows this change. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- include/uapi/linux/btrfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] btrfs-progs: fix wrong pad for userspace arg of btrfs dev stat

2014-10-15 Thread Gui Hecheng
The @btrfs_ioctl_get_dev_stats fails to pad to 1k as descripted, actually it valuates to 1032 bytes. Correct it following the kernel patch. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ioctl.h b/ioctl.h index

[PATCH] btrfs-progs: prevent silent damage when add dev to an invalid mntpnt

2014-10-15 Thread Gui Hecheng
is a valid mntpnt by calling @find_mount_root() to prevent this silent damage. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-device.c | 17 + 1 file changed, 17 insertions(+) diff --git a/cmds-device.c b/cmds-device.c index a728f21..65815c3 100644 --- a/cmds-device.c

Check ping

2014-10-07 Thread Gui Hecheng
Check ping -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] btrfs-progs: fix BUG_ON when all devices under seed fs are missing

2014-10-06 Thread Gui Hecheng
will report unable to open the device. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- *Note* This should be after patch: Btrfs-progs: fsck: disallow partial opening if critical \ roots corrupted --- volumes.c | 11 +-- 1 file

Re: [PATCH v4] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-23 Thread Gui Hecheng
On Tue, 2014-09-23 at 10:25 +0800, Gui Hecheng wrote: When runing restore under lzo compression, bad compress length problems are encountered. It is because there is a page align problem with the @decompress_lzo, as follows

[PATCH v4] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-23 Thread Gui Hecheng
are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less than 4 bytes left, then we should fetch the next @len at the start of next page. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Marc Dietrich marvi

[PATCH v2] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-22 Thread Gui Hecheng
are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less than 4 bytes left, then we should fetch the next @len at the start of next page. Signed-off-by: Marc Dietrich marvi...@gmx.de Signed-off-by: Gui Hecheng guihc.f

Re: fs corruption report

2014-09-22 Thread Gui Hecheng
On Mon, 2014-09-22 at 10:19 +0200, Marc Dietrich wrote: Hi, Am Freitag, 19. September 2014, 09:30:30 schrieb Gui Hecheng: On Thu, 2014-09-18 at 12:47 +, Zooko Wilcox-OHearn wrote: Thank you! I will try to restore using this patch. What branch of what btrfs tools git repo should

Re: [PATCH v2] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-22 Thread Gui Hecheng
On Mon, 2014-09-22 at 10:44 +0200, Marc Dietrich wrote: Am Montag, 22. September 2014, 16:29:28 schrieb Gui Hecheng: When runing restore under lzo compression, bad compress length problems are encountered. It is because there is a page align problem with the @decompress_lzo, as follows

Re: fs corruption report

2014-09-22 Thread Gui Hecheng
On Mon, 2014-09-22 at 10:49 +0200, Marc Dietrich wrote: Am Montag, 22. September 2014, 16:33:56 schrieb Gui Hecheng: On Mon, 2014-09-22 at 10:19 +0200, Marc Dietrich wrote: Hi, Am Freitag, 19. September 2014, 09:30:30 schrieb Gui Hecheng: On Thu, 2014-09-18 at 12:47 +, Zooko

[PATCH v3] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-22 Thread Gui Hecheng
are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less than 4 bytes left, then we should fetch the next @len at the start of next page. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Marc Dietrich marvi

Re: [PATCH v3] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-22 Thread Gui Hecheng
On Mon, 2014-09-22 at 15:41 +0200, David Sterba wrote: On Mon, Sep 22, 2014 at 04:58:26PM +0800, Gui Hecheng wrote: So we check page alignment every time before we are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less

[PATCH v4] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-22 Thread Gui Hecheng
are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less than 4 bytes left, then we should fetch the next @len at the start of next page. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com Reviewed-by: Marc Dietrich marvi

Re: [PATCH 3/3] btrfs-progs: fix device missing of btrfs fi show with seeding devices

2014-09-18 Thread Gui Hecheng
On Thu, 2014-09-18 at 13:59 +0800, Anand Jain wrote: Hi Gui, Thanks for the attempt to fix this. more below.. On 09/18/2014 11:31 AM, Gui Hecheng wrote: *Note*: this handles the problem under umounted state, the problem under mounted state is already fixed by Anand. Steps

Re: [PATCH] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-18 Thread Gui Hecheng
On Thu, 2014-09-18 at 10:25 +0200, Marc Dietrich wrote: Hello Gui, Am Donnerstag, 18. September 2014, 11:34:43 schrieb Gui Hecheng: When runing restore under lzo compression, bad compress length problems are encountered. It is because there is a page align problem

Re: [PATCH] Btrfs-progs: super-recover: fix double free fs_devices memory

2014-09-18 Thread Gui Hecheng
On Thu, 2014-09-18 at 05:01 -0400, Wang Shilong wrote: super-recover collects btrfs devices infomation using existed functions scan_one_devices(). Problem is fs_devices is freed twice in close_ctree() and free_recover_superblock() for super correction path. Fix this problem by checking

Re: [PATCH] btrfs-progs: fix page align issue for lzo compress inrestore

2014-09-18 Thread Gui Hecheng
On Thu, 2014-09-18 at 11:25 +0200, Marc Dietrich wrote: Am Donnerstag, 18. September 2014, 17:10:54 schrieb Gui Hecheng: On Thu, 2014-09-18 at 10:25 +0200, Marc Dietrich wrote: Hello Gui, Am Donnerstag, 18. September 2014, 11:34:43 schrieb Gui Hecheng: When runing restore under

Re: fs corruption report

2014-09-18 Thread Gui Hecheng
On Thu, 2014-09-18 at 12:47 +, Zooko Wilcox-OHearn wrote: Thank you! I will try to restore using this patch. What branch of what btrfs tools git repo should I apply the patch to? Regards, Zooko At least I think the following repo/v3.17.x branch has all restore-related patches

[PATCH 2/3] btrfs-progs: remove scan_for_btrfs()

2014-09-17 Thread Gui Hecheng
From: Anand Jain anand.j...@oracle.com With the changes as in the previous patch, now scan_for_btrfs() is an unused function. So delete it. Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 15 --- utils.h | 1 - 2 files changed, 16 deletions(-) diff --git a/utils.c

[PATCH 1/3] btrfs-progs: remove BTRFS_SCAN_PROC scan method

2014-09-17 Thread Gui Hecheng
From: Anand Jain anand.j...@oracle.com The libblkid scan method which was introduced later, will also scan devices under /proc/partitions. So we don't have to do the explicit scan of the same. Remove the scan method BTRFS_SCAN_PROC. Signed-off-by: Anand Jain anand.j...@oracle.com ---

[PATCH 3/3] btrfs-progs: fix device missing of btrfs fi show with seeding devices

2014-09-17 Thread Gui Hecheng
with the seeding devices properly, so we can make use of it to find seeding devices. We call @open_ctree on every block device with a btrfs on it, and all devices under the opening filesystem including the seed devices will be ready to be shown. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds

[PATCH] btrfs-progs: fix page align issue for lzo compress in restore

2014-09-17 Thread Gui Hecheng
position to read the len of next piece of data when bad compress length is encounterd. If we still get bad compress length in this case, then there is a real bad compress length, and we shall report error. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 20

Re: fs corruption report

2014-09-17 Thread Gui Hecheng
On Mon, 2014-09-01 at 15:25 +, Zooko Wilcox-OHearn wrote: I'm more than happy to try out patches and even focus my own brain on diagnosing it, if I can. I'm hoping to regain access to some of my files on my btrfs partition, and also I would enjoy helping get this improved. :-) So if you

Re: How to deal with The chunks in memory can not match the metadata of the fs. Repair failed.?

2014-09-15 Thread Gui Hecheng
On Mon, 2014-09-15 at 16:59 +0200, Karl-Philipp Richter wrote: Hi together, I'm currently encountering another issue with `btrfs rescue chunk-recover`. After some seconds of maximal I/O activity, the program is idle for some seconds and then prints The chunks in memory can not match

Re: [PATCH v2] btrfs-progs: deal with conflict options for btrfs fi show

2014-09-12 Thread Gui Hecheng
On Fri, 2014-09-12 at 14:56 +0900, Satoru Takeuchi wrote: Hi Gui, (2014/09/12 10:15), Gui Hecheng wrote: For btrfs fi show, -d|--all-devices -m|--mounted will overwrite each other, so if specified both, let the user know that he should not use them at the same time. Signed-off

[PATCH v2] btrfs-progs: deal with conflict options for btrfs fi show

2014-09-11 Thread Gui Hecheng
For btrfs fi show, -d|--all-devices -m|--mounted will overwrite each other, so if specified both, let the user know that he should not use them at the same time. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- changelog: v1-v2: add option conflict descriptions to manpage

[PATCH] btrfs-progs: deal with conflict options for btrfs fi show

2014-09-10 Thread Gui Hecheng
For btrfs fi show, -d|--all-devices -m|--mounted will overwrite each other, so if specified both, let the user know that he should not use them at the same time. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-filesystem.c | 11 +-- 1 file changed, 9 insertions(+), 2

Re: fs corruption report

2014-09-03 Thread Gui Hecheng
On Mon, 2014-09-01 at 15:25 +, Zooko Wilcox-OHearn wrote: I'm more than happy to try out patches and even focus my own brain on diagnosing it, if I can. I'm hoping to regain access to some of my files on my btrfs partition, and also I would enjoy helping get this improved. :-) So if you

[PATCH] btrfs-progs: remove btrfs_release_path before btrfs_free_path

2014-09-03 Thread Gui Hecheng
The btrfs_free_path calls btrfs_release_path internally. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- disk-io.c | 1 - file-item.c | 1 - inode-map.c | 2 -- 3 files changed, 4 deletions(-) diff --git a/disk-io.c b/disk-io.c index 9e44f10..0f9f374 100644 --- a/disk-io.c +++ b/disk

[PATCH] btrfs-progs: remove wrong set_argv0 for restore

2014-09-03 Thread Gui Hecheng
@set_argv0() before check_argc_* to repair the prompt tool name before too few arguments. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index f909429..38a131e 100644 --- a/cmds-restore.c +++ b/cmds

Re: [PATCH 3/3] btrfs-progs: remove meaningless debug info for restore

2014-08-31 Thread Gui Hecheng
On Fri, 2014-08-29 at 16:49 +0200, David Sterba wrote: On Thu, Aug 28, 2014 at 10:25:55AM +0800, Gui Hecheng wrote: The printf of @offset enlightens the user little. And the restore cmd is not a debugging tool, so just remove the debug-info-like printf. I'd like to let the restore

[PATCH 2/3] btrfs-progs: fix next_leaf in restore as it improperly skips some slots

2014-08-27 Thread Gui Hecheng
When entering the next level node, the @next_leaf in restore forgets to start at the first slot. Just reset it to the first one. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-restore.c b/cmds-restore.c index

[PATCH 3/3] btrfs-progs: remove meaningless debug info for restore

2014-08-27 Thread Gui Hecheng
The printf of @offset enlightens the user little. And the restore cmd is not a debugging tool, so just remove the debug-info-like printf. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c

[PATCH 1/3] btrfs-progs: fix len of read_extent_buffer for inline extent in restore

2014-08-27 Thread Gui Hecheng
of the inline item. So in the compressed situation, use the len of the inline item. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index bb72311..e94592c 100644 --- a/cmds

Re: fs corruption report

2014-08-27 Thread Gui Hecheng
On Mon, 2014-08-25 at 05:08 +, Zooko Wilcox-OHearn wrote: Dear people of linux-btrfs: Thank you for btrfs! It is a beautiful thing. I say that in spite of the fact that it seems to have failed and eaten some of my data. I'm writing with two purposes: to get help and advice in

Re: fs corruption report

2014-08-27 Thread Gui Hecheng
BTW,there is a develop branch from the btrfs-progs's maintainer David: http://github.com/kdave/btrfs-progs.git Maybe you'd like to try it, it may make some differences. -Gui On Mon, 2014-08-25 at 05:08 +, Zooko Wilcox-OHearn wrote: Dear people of linux-btrfs: Thank you for btrfs! It is

Re: btrfs restore memory corruption (bug: 82701)

2014-08-25 Thread Gui Hecheng
On Mon, 2014-08-25 at 10:58 +0200, Marc Dietrich wrote: Am Freitag 22 August 2014, 10:42:18 schrieb Marc Dietrich: Am Freitag, 22. August 2014, 14:43:45 schrieb Gui Hecheng: On Thu, 2014-08-21 at 16:19 +0200, Marc Dietrich wrote: Am Donnerstag, 21. August 2014, 17:52:16 schrieb Gui

Re: btrfs restore memory corruption (bug: 82701)

2014-08-22 Thread Gui Hecheng
On Thu, 2014-08-21 at 16:19 +0200, Marc Dietrich wrote: Am Donnerstag, 21. August 2014, 17:52:16 schrieb Gui Hecheng: On Mon, 2014-08-18 at 11:25 +0200, Marc Dietrich wrote: Hi, I did a checkout of the latest btrfs progs to repair my damaged filesystem. Running btrfs restore

Re: btrfs restore memory corruption (bug: 82701)

2014-08-22 Thread Gui Hecheng
On Fri, 2014-08-22 at 10:42 +0200, Marc Dietrich wrote: Am Freitag, 22. August 2014, 14:43:45 schrieb Gui Hecheng: On Thu, 2014-08-21 at 16:19 +0200, Marc Dietrich wrote: Am Donnerstag, 21. August 2014, 17:52:16 schrieb Gui Hecheng: On Mon, 2014-08-18 at 11:25 +0200, Marc Dietrich wrote

Re: [PATCH] btrfs-progs: init uninitialized output buf for btrfs-restore

2014-08-21 Thread Gui Hecheng
On Thu, 2014-08-21 at 10:14 +0200, Marc Dietrich wrote: Hi Gui, Am Donnerstag, 21. August 2014, 11:35:36 schrieb Gui Hecheng: A memory problem reported by valgrind as follows: === Syscall param pwrite64(buf) points to uninitialised byte(s) When running: # valgrind --leak-check

Re: btrfs restore memory corruption (bug: 82701)

2014-08-21 Thread Gui Hecheng
On Mon, 2014-08-18 at 11:25 +0200, Marc Dietrich wrote: Hi, I did a checkout of the latest btrfs progs to repair my damaged filesystem. Running btrfs restore gives me several failed to inflate: -6 and crashes with some memory corruption. I ran it again with valgrind and got: valgrind

[PATCH 1/2] btrfs-progs: cleanup duplicate assignment of variable leaf for btrfs-restore

2014-08-20 Thread Gui Hecheng
The value of variable leaf in while loop don't have to be set for every round. Just move it outside. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index a6f535c

[PATCH 2/2] btrfs-progs: remove unused flags for btrfs_path

2014-08-20 Thread Gui Hecheng
routines will decide their behavior on these. So just remove them. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 2 -- ctree.h| 3 --- extent-tree.c | 6 -- 3 files changed, 11 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c index f417e0b..bfd883d

Re: btrfs restore memory corruption (bug: 82701)

2014-08-20 Thread Gui Hecheng
On Mon, 2014-08-18 at 11:25 +0200, Marc Dietrich wrote: Hi, I did a checkout of the latest btrfs progs to repair my damaged filesystem. Running btrfs restore gives me several failed to inflate: -6 and crashes with some memory corruption. I ran it again with valgrind and got: valgrind

[PATCH] btrfs-progs: init uninitialized output buf for btrfs-restore

2014-08-20 Thread Gui Hecheng
is shorter than the sizeof(buf), so valgrind report uninitialised byte(s). We could use calloc to repalce malloc and clear this WARNING away. Reported-by: Marc Dietrich marvi...@gmx.de Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-restore.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 1/3] btrfs-progs: check option conflict for btrfs-convert

2014-08-06 Thread Gui Hecheng
The -d, -i, -n options make no sense to rollback. Check the improper usages such as: # btrfs-convert -r -d dev Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- btrfs-convert.c | 13 + 1 file changed, 13 insertions(+) diff --git a/btrfs-convert.c b/btrfs-convert.c

  1   2   3   >