RE: [PATCH 2/5] btrfs: use a separate variable to store the num_bytes of the qgroup_reserve

2018-08-07 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Wednesday, August 08, 2018 12:19 AM > To: Lu, Fengqi/陆 丰麒 > Cc: linux-btrfs@vger.kernel.org; Gu, Jinxiang/顾 金香 > Subject: Re: [PATCH 2/5] btrfs: use a separate variable to stor

[PATCH v2] btrfs: fix bug of chunk type check

2018-07-20 Thread Gu Jinxiang
one of them separately. Reported-by: Dan Carpenter Signed-off-by: Gu Jinxiang --- Changelog: v2: As comment by Qu, change the print format of bit from %llu to 0x%llx. fs/btrfs/volumes.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/b

RE: [bug report] btrfs: Add type check when reading a chunk

2018-07-19 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Thursday, July 19, 2018 6:14 PM > To: dste...@suse.cz; Gu, Jinxiang/顾 金香 ; Dan Carpenter > ; > linux-btrfs@vger.kernel.org > Subject: Re: [bug report] btrfs: Add type check when reading a c

[PATCH] btrfs: fix bug of chunk type check

2018-07-19 Thread Gu Jinxiang
one of them separately. Reported-by: Dan Carpenter Signed-off-by: Gu Jinxiang --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 3f2f01ad9356..c7d009e45472 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volum

RE: [bug report] btrfs: Add type check when reading a chunk

2018-07-19 Thread Gu, Jinxiang
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Thursday, July 19, 2018 4:11 PM > To: Gu, Jinxiang/顾 金香 > Cc: linux-btrfs@vger.kernel.org > Subject: [bug report] btrfs: Add type check when reading a chunk > > Hello Gu

RE: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Monday, July 16, 2018 8:34 PM > To: Gu, Jinxiang/顾 金香 > Cc: linux-btrfs@vger.kernel.org; anand.j...@oracle.com > Subject: Re: [PATCH v5 2/2] btrfs: get device pointer from > btrfs_scan_o

[PATCH v5 0/2] btrfs: do some parameters optimization

2018-07-16 Thread Gu Jinxiang
Do parameters optimization for function btrfs_parse_early_options and btrfs_scan_one_device. Gu Jinxiang (2): btrfs: make fs_devices to be a local variable btrfs: get device pointer from btrfs_scan_one_device fs/btrfs/super.c | 38 -- fs/btrfs/volumes.c

[PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. And since btrfs_fs_devices can be get by btrfs_device, better to return btrfs_device than fs_btrfs_devices. Signed-off-by: Gu Jinxiang --- Changelog: v5: rebase to misc-next. v4

[PATCH v5 1/2] btrfs: make fs_devices to be a local variable

2018-07-16 Thread Gu Jinxiang
-> btrfs_parse_early_options ->btrfs_scan_one_device So, there is no necessary to pass fs_devices from btrfs_mount_root, use a local variable in btrfs_parse_early_options is enough. Signed-off-by: Gu Jinxiang Reviewed-by: Anand Jain --- Changelog: v5: change a line wrap, and rebase to misc-ne

[PATCH v4 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-12 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. And since btrfs_fs_devices can be get by btrfs_device, better to return btrfs_device than fs_btrfs_devices. Signed-off-by: Gu Jinxiang --- Changelog: v4: as suggested by Anand

[PATCH v4 1/2] btrfs: make fs_devices to be a local variable

2018-07-12 Thread Gu Jinxiang
-> btrfs_parse_early_options ->btrfs_scan_one_device So, there is no necessary to pass fs_devices from btrfs_mount_root, use a local variable in btrfs_parse_early_options is enough. Signed-off-by: Gu Jinxiang Reviewed-by: Anand Jain --- Changelog: v4: changed a line warp, and adjusted the order

[PATCH v3 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device

2018-07-10 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. Signed-off-by: Gu Jinxiang --- Changelog: v3: as comment by robot, use PTR_ERR_OR_ZERO, and rebase to misc-next. v2: as comment by Nikolay, use ERR_CAST instead of cast type manually

[PATCH v3 1/2] btrfs: make fs_devices to be a local variable

2018-07-10 Thread Gu Jinxiang
-> btrfs_parse_early_options ->btrfs_scan_one_device So, there is no necessary to pass fs_devices from btrfs_mount_root, use a local variable in btrfs_parse_early_options is enough. Signed-off-by: Gu Jinxiang --- Changelog: v3: rebase to misc-next. v2: deal with Nikolay's comment, make changelo

RE: [PATCH 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device

2018-07-10 Thread Gu, Jinxiang
Duplicate one, please ignore this. > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Gu Jinxiang > Sent: Tuesday, July 10, 2018 6:27 PM > To: linux-btrfs@vger.kernel.org > Cc: nbori...@suse.com >

[PATCH v2 1/2] btrfs: make fs_devices to be a local variable

2018-07-10 Thread Gu Jinxiang
-> btrfs_parse_early_options ->btrfs_scan_one_device So, there is no necessary to pass fs_devices from btrfs_mount_root, use a local variable in btrfs_parse_early_options is enough. Signed-off-by: Gu Jinxiang --- changelog: v2: deal with Nikolay's comment, make changelog more clair. fs/btrfs/super

[PATCH 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device

2018-07-10 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. Signed-off-by: Gu Jinxiang --- fs/btrfs/super.c | 29 ++--- fs/btrfs/volumes.c | 14 +++--- fs/btrfs/volumes.h | 4 ++-- 3 files changed, 27

[PATCH v2 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device

2018-07-10 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. Signed-off-by: Gu Jinxiang --- changelog: v2: as comment by Nikolay, use ERR_CAST instead of cast type manually. fs/btrfs/super.c | 29 ++--- fs/btrfs

[PATCH 1/2] btrfs: make fs_devices to be a local variable

2018-07-10 Thread Gu Jinxiang
Since output parameter fs_devices of btrfs_parse_early_options is not used in the caller, make it be a local variable. Signed-off-by: Gu Jinxiang --- fs/btrfs/super.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index

[PATCH 2/2] btrfs: get fs_devices pointer form btrfs_scan_one_device

2018-07-10 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. Signed-off-by: Gu Jinxiang --- fs/btrfs/super.c | 29 ++--- fs/btrfs/volumes.c | 14 +++--- fs/btrfs/volumes.h | 4 ++-- 3 files changed, 27

[PATCH] btrfs: remove unused parameter

2018-07-09 Thread Gu Jinxiang
Since parameter flags is no more used since commit d7407606564c ("btrfs: split parse_early_options() in two"), remove it. Signed-off-by: Gu Jinxiang --- fs/btrfs/super.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/sup

RE: [PATCH v2 1/2] btrfs: Check each block group has corresponding chunk at mount time

2018-07-06 Thread Gu, Jinxiang
flags, > + (BTRFS_BLOCK_GROUP_TYPE_MASK & > + em->map_lookup->type)); > + ret = -EUCLEAN; > + } else { > + ret = 0;

RE: [PATCH 4/4] btrfs-progs: check/original: Don't overwrite return value when we failed to repair

2018-07-05 Thread Gu, Jinxiang
uct btrfs_root *root, > free_inode_rec(rec); > continue; > } > - ret = 0; > } > > if (!(repair && ret == 0)) > -- Reviewed-by: Gu Jinxiang

RE: [PATCH 3/4] btrfs-progs: check/original: Avoid infinite loop when failed to repair inode

2018-07-05 Thread Gu, Jinxiang
> + * root and fail to repair, must skip this root > to > + * avoid infinite loop > + */ > + if (repair) > + skip_root = key.objectid; > +

RE: [PATCH 1/4] btrfs-progs: check: Remove the ability to rebuild root overwritting existing tree blocks

2018-07-05 Thread Gu, Jinxiang
> -Original Message- > From: Qu Wenruo [mailto:quwenruo.bt...@gmx.com] > Sent: Thursday, July 05, 2018 5:41 PM > To: Gu, Jinxiang/顾 金香 ; Qu Wenruo ; > linux-btrfs@vger.kernel.org > Subject: Re: [PATCH 1/4] btrfs-progs: check: Remove the ability to rebuild > root

RE: [PATCH 2/4] btrfs-progs: transaction: Error out other than panic when committing transaction

2018-07-05 Thread Gu, Jinxiang
_info->pinned_extents); > @@ -176,7 +182,8 @@ commit_tree: > root->commit_root = NULL; > fs_info->running_transaction = NULL; > fs_info->last_trans_committed = transid; > - return 0; > +out: > + return ret; > } > > void btrfs_abort_tra

RE: [PATCH 1/4] btrfs-progs: check: Remove the ability to rebuild root overwritting existing tree blocks

2018-07-05 Thread Gu, Jinxiang
ent root initialization failed\n"); > /* > @@ -9764,7 +9754,7 @@ int cmd_check(int argc, char **argv) > > if (init_csum_tree) { > printf("Reinitialize checksum tree\n"); > - ret = btrfs_fsck_reinit_root(trans, info

[PATCH v3] btrfs: Add chunk type check in read a chunk

2018-07-04 Thread Gu Jinxiang
Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, which has a invalid chunk, not return error opportunlly. Add chunk type check in btrfs_check_chunk_valid, to make error be returned in advance. Reported-by: Xu Wen Signed-off-by: Gu Jinxiang Reviewed-by: Qu Wenruo --- changelog

RE: [PATCH v2] btrfs: Add chunk type check in read a chunk

2018-07-04 Thread Gu, Jinxiang
> -Original Message- > From: Nikolay Borisov [mailto:nbori...@suse.com] > Sent: Wednesday, July 04, 2018 4:15 PM > To: Gu, Jinxiang/顾 金香 ; linux-btrfs@vger.kernel.org > Cc: quwenruo.bt...@gmx.com; wen...@gatech.edu; xuwen.s...@gmail.com > Subject: Re: [PATCH v2] btr

RE: [PATCH 2/5] btrfs: tree-checker: Detect invalid empty essential tree

2018-07-04 Thread Gu, Jinxiang
D) { > + generic_err(fs_info, leaf, 0, > + "invalid root, root %llu should never be empty", > + owner); > + return -EUCLEAN; > + } > key.objectid = btrfs

RE: [PATCH 3/5] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized

2018-07-04 Thread Gu, Jinxiang
_root_tree.lock); > - > - if (!node) > - return; > - BUG_ON((struct btrfs_root *)node->data != root); > > spin_lock(_info->trans_lock); > list_del_init(>root_list); > -- Tested-by: Gu Jinxiang > 2.18.0 > > -- > 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 >

RE: [PATCH 1/5] btrfs: tree-checker: Verify block_group_item

2018-07-04 Thread Gu, Jinxiang
9e23b4..b33bf29130b6 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -4690,7 +4690,7 @@ static int __btrfs_alloc_chunk(struct > btrfs_trans_handle *trans, > > if (type & BTRFS_BLOCK_GROUP_DATA) { > max_stripe_size = SZ_1G; > -

RE: [PATCH 5/5] btrfs: Verify every chunk has corresponding block group at mount time

2018-07-04 Thread Gu, Jinxiang
ree_extent_map(em); > + btrfs_put_block_group(bg); > + } > + return ret; > +} > + > int btrfs_read_block_groups(struct btrfs_fs_info *info) > { > struct btrfs_path *path; > @@ -10227,7 +10277,7 @@ int btrfs_read_block_groups(struct btrfs_f

RE: [PATCH 4/5] btrfs: Check each block group has corresponding chunk at mount time

2018-07-03 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Qu Wenruo > Sent: Tuesday, July 03, 2018 5:10 PM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH 4/5] btrfs: Check each block group has corresponding chunk at >

RE: [PATCH 3/5] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized

2018-07-03 Thread Gu, Jinxiang
oot_tree.lock); > - > - if (!node) > - return; > - BUG_ON((struct btrfs_root *)node->data != root); > > spin_lock(_info->trans_lock); > list_del_init(>root_list); > -- Reviewed-by: Gu Jinxiang > 2.18.0 > > -- > To unsub

RE: [PATCH 2/5] btrfs: tree-checker: Detect invalid empty essential tree

2018-07-03 Thread Gu, Jinxiang
D) { > + generic_err(fs_info, leaf, 0, > + "invalid root, root %llu should never be empty", > + owner); > + return -EUCLEAN; > + } > key.objectid = btrfs_h

RE: [PATCH 1/5] btrfs: tree-checker: Verify block_group_item

2018-07-03 Thread Gu, Jinxiang
9e23b4..b33bf29130b6 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -4690,7 +4690,7 @@ static int __btrfs_alloc_chunk(struct > btrfs_trans_handle *trans, > > if (type & BTRFS_BLOCK_GROUP_DATA) { > max_stripe_size = SZ_1G; > -

[PATCH v2] btrfs: Add chunk type check in read a chunk

2018-07-03 Thread Gu Jinxiang
Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, which has a invalid chunk, not return error opportunlly. Add chunk type check in btrfs_check_chunk_valid, to make error be returned in advance. Reported-by: Xu Wen Signed-off-by: Gu Jinxiang --- changelog: v2: deal with comment

[PATCH] btrfs: Add chunk type check in read a chunk

2018-07-02 Thread Gu Jinxiang
Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, which has a invalid chunk, not return error opportunlly. Add chunk type check in btrfs_check_chunk_valid, to make error be returned in advance. Signed-off-by: Gu Jinxiang --- fs/btrfs/volumes.c | 6 ++ 1 file changed, 6

[PATCH 2/2] btrfs: drop useless member qgroup_reserved of btrfs_pending_snapshot

2018-05-29 Thread Gu Jinxiang
From: Gu JinXiang Since there is no more use of qgroup_reserved member in struct btrfs_pending_snapshot, remove it. Signed-off-by: Gu JinXiang --- fs/btrfs/transaction.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index d8c0826bc2c7

[PATCH 1/2] btrfs: drop unused parameter qgroup_reserved

2018-05-29 Thread Gu Jinxiang
From: Gu JinXiang Since commit 7775c8184ec0 ("btrfs: remove unused parameter from btrfs_subvolume_release_metadata") parameter qgroup_reserved is not used by caller of function btrfs_subvolume_reserve_metadata. So remove it. Signed-off-by: Gu JinXiang --- fs/btrfs/ctree.h |

[PATCH] btrfs: set device state reappearing missing device

2018-05-29 Thread Gu Jinxiang
From: Gu JinXiang patch for commit 921518924084 ("btrfs: handle dynamically reappearing missing device"). Since BTRFS_DEV_STATE_IN_FS_METADATA will be clear in btrfs_open_one_device, and when alloc a new chunk in __btrfs_alloc_chunk, device with BTRFS_DEV_STATE_IN_FS_METADATA

[PATCH v2] btrfs: handle failures of set_extent_bits in add_excluded_extent

2018-05-22 Thread Gu Jinxiang
set_extent_bits may fail, return the result in add_excluded_extent. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> Changelog: v2-v1: 1.remove goto to make the function run linearly. 2.change commit description not pointing out the failure detail, since set_extent_bits's failure ty

[PATCH 2/2] btrfs: propagate failures of __exclude_logged_extent to upper caller

2018-05-22 Thread Gu Jinxiang
Function btrfs_exclude_logged_extents may call __exclude_logged_extent which may fail. Propagate the failures of __exclude_logged_extent to upper caller. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/extent-tree.c | 9 +++-- 1 file changed, 7 insertions(+), 2 del

[PATCH 1/2] btrfs: handle failures of set_extent_bits in add_excluded_extent

2018-05-22 Thread Gu Jinxiang
set_extent_bits may return 0/-EEXIST, so return the result in add_excluded_extent. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/extent-tree.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c

[PATCH] btrfs: handle failures of set_extent_bits in add_excluded_extent

2018-05-21 Thread Gu Jinxiang
ogged_extent to btrfs_exclude_logged_extents. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/extent-tree.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 75cfb80d2551..28fd71579141 100644 --- a/fs/btrfs/exte

[PATCH] btrfs: remove unnecessary if judge

2018-05-21 Thread Gu Jinxiang
Since add_excluded_extent always returns 0, no need to judge ret. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/extent-tree.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 75cfb80d2551..4d876b32e136 100644 --

RE: [PATCH v6 3/3] btrfs: Add unprivileged version of ino_lookup ioctl

2018-05-18 Thread Gu, Jinxiang
called. If > constructed path does not exist under fd's inode, -EACCES > will be returned. > 3. The name of bottom subvolume is also searched and filled. > > Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1) > bytes than ino_lookup ioctl because of space of >

RE: [PATCH v6 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF

2018-05-18 Thread Gu, Jinxiang
gt; + struct { > + __u64 subvolid; > + __u64 dirid; > + } rootref[BTRFS_MAX_ROOTREF_BUFFER_NUM]; > + /* out, number of found items */ > + __u8 num_items; > + __u8 align[7]; > +}; > + > /* Error

RE: [PATCH v6 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-18 Thread Gu, Jinxiang
send/receive happens */ > + __u64 ctransid; > + __u64 otransid; > + __u64 stransid; > + __u64 rtransid; > + /* Time corresponds to c/o/s/rtransid */ > + struct btrfs_ioctl_timespec ctime; > + struct btrfs_ioctl_timespec otime; > + struct btrfs_ioctl_timespec s

[PATCH] btrfs-progs: Add DEBUG_CFLAGS_INTERNAL for libbtrfsutil

2018-05-18 Thread Gu Jinxiang
From: Gu JinXiang <g...@cn.fujitsu.com> Add DEBUG_CFLAGS_INTERNAL to LIBBTRFSUTIL_CFLAGS for libbtrfsutil's build. Signed-off-by: Gu JinXiang <g...@cn.fujitsu.com> --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index cbd85533..1e38a56f 100644 --

RE: [PATCH v6 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF

2018-05-17 Thread Gu, Jinxiang
gt; + struct { > + __u64 subvolid; > + __u64 dirid; > + } rootref[BTRFS_MAX_ROOTREF_BUFFER_NUM]; > + /* out, number of found items */ > + __u8 num_items; > + __u8 align[7]; > +}; > + > /* Error codes as r

RE: [PATCH v6 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-17 Thread Gu, Jinxiang
send/receive happens */ > + __u64 ctransid; > + __u64 otransid; > + __u64 stransid; > + __u64 rtransid; > + /* Time corresponds to c/o/s/rtransid */ > + struct btrfs_ioctl_timespec ctime; > + struct btrfs_ioctl_timespec otime; > + struct btrfs_ioctl_t

RE: [PATCH v5 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF

2018-05-17 Thread Gu, Jinxiang
Hi, > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono > Sent: Wednesday, May 16, 2018 1:50 PM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH v5 2/3] btrfs: Add unprivileged ioctl which returns >

RE: [PATCH v5 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-17 Thread Gu, Jinxiang
_uuid[BTRFS_UUID_SIZE]; > + > + /* Transaction id indicates when change/create/send/receive happens */ > + __u64 ctransid; > + __u64 otransid; > + __u64 stransid; > + __u64 rtransid; > + /* Time corresponds to c/o/s/rtransid */ > + struct btrfs_ioctl_timespec c

RE: [PATCH v4 3/3] btrfs: Add unprivileged version of ino_lookup ioctl

2018-05-16 Thread Gu, Jinxiang
efine BTRFS_INO_LOOKUP_USER_PATH_MAX (4080-BTRFS_VOL_NAME_MAX-1) > +struct btrfs_ioctl_ino_lookup_user_args { > + /* in, inode number containing the subvolume of 'subvolid' */ > + __u64 dirid; > + /* in */ > + __u64 subvolid; > + /* out, name of the subvolume of 'subvolid' */ > + char name

[PATCH] btrfs-progs: remove BTRFS_LIST_LAYOUT_RAW

2018-05-15 Thread Gu Jinxiang
Since commit 9005b603d723 ("btrfs-progs: use libbtrfsutil for subvol show"), BTRFS_LIST_LAYOUT_RAW has no usage. So, remove it. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- btrfs-list.c | 20 btrfs-list.h | 3 +-- 2 files changed, 1 insertion(

RE: [PATCH v4 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-15 Thread Gu, Jinxiang
Hi, add a missed a comment. > -Original Message- > From: Misono Tomohiro [mailto:misono.tomoh...@jp.fujitsu.com] > Sent: Tuesday, May 15, 2018 3:04 PM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com>; linux-btrfs@vger.kernel.org > Subject: Re: [PATCH v4 1/3] btrfs: A

RE: [PATCH v4 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF

2018-05-15 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono > Sent: Friday, May 11, 2018 3:26 PM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH v4 2/3] btrfs: Add unprivileged ioctl which returns >

RE: [PATCH v4 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-15 Thread Gu, Jinxiang
_u64 ctransid; > + __u64 otransid; > + __u64 stransid; > + __u64 rtransid; > + /* Time corresponds to c/o/s/rtransid */ > + struct btrfs_ioctl_timespec ctime; > + struct btrfs_ioctl_timespec otime; > + struct btrfs_ioctl_timespec stime; > + s

[PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK

2018-04-27 Thread Gu Jinxiang
off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 292266f6ab9c..1a3506a3003d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4473,7 +4473,7 @@ int btrfs_shri

[PATCH] btrfs: remove unused fs_info parameter

2018-04-26 Thread Gu Jinxiang
Since the commit below parameter fs_info in alloc_reloc_control be no used. So remove it. commit c6100a4b4e3d ("Btrfs: replace tree->mapping with tree->private_data") Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- fs/btrfs/relocation.c | 6 +++--- 1 file chang

RE: btrfs check : check/main.c:3654: check_owner_ref: BUG_ON `rec->is_root` triggered, value `

2018-04-22 Thread Gu, Jinxiang
Hi Thanks for reporting. May be the same bug reproduced by using $sudo TEST=003\* make test-fuzz in btrfs-progs. More details in: https://patchwork.kernel.org/patch/10073937/ > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org]

[bug report] btrfs fail when run xfstests-dev/btrfs/007

2018-04-20 Thread Gu, Jinxiang
//btrfs/007.out.bad' to see the entire diff) And the detail can be found in the attachment. Thanks, Gu Jinxiang 007.full Description: 007.full

RE: [PATCH RESEND v4 0/4] device_list_add() peparation to add reappearing missing device

2018-04-20 Thread Gu, Jinxiang
Hi, I reproduced this using kernel v4.17-rc1. It is not always happens.( occurred times/test times: 1/20) > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Anand Jain > Sent: Tuesday, January 23, 2018 5:53 AM > To:

[PATCH v2] btrfs-progs: remove meaningless process

2018-04-11 Thread Gu Jinxiang
a child process to wait for scrub over. So remove unnecessary process. Since parent process go out immediately, so remove SIGINT process of parent process too. Changelog: v2: remove the SIGINT process of parent process. v1: remove do_wait variable and wait process Signed-off-by: Gu Jinxiang &l

[PATCH] btrfs-progs: remove meaningless process

2018-04-11 Thread Gu Jinxiang
a child process to wait for scrub over. So remove unnecessary process. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- cmds-scrub.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index efd7db94..3fb16887 100644 --- a/cmds-scrub.c

[PATCH] btrfs-progs: remove meaningless field write of scrub status file

2018-04-09 Thread Gu Jinxiang
Since ret must be 0 when goes to scrub status file's write, so scrub_write_buf(fd, buf, ret) writes nothing. And when I check the process for read scrub status file, there is no process for this field. So, remove it. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- cmds-scrub.c | 1 -

[PATCH] btrfs-progs: remove unused function path_cat and path_cat3

2018-04-08 Thread Gu Jinxiang
Since function path_cat and path_cat3 are not used anymore, remove them. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- send-utils.c | 25 - send-utils.h | 9 - 2 files changed, 34 deletions(-) diff --git a/send-utils.c b/send-utils.c index b5

[PATCH] btrfs-progs: mark -f option of btrfs scrub start deprecated

2018-04-08 Thread Gu Jinxiang
Since in the commit below detect the scrub information automatically, -f option is no more need. Let's make it deprecated. commit d5fd05a773e2 ("btrfs-progs: scrub, detect stale information in the status file") Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- Doc

[PATCH] btrfs-progs: Remove duplicate value-get for data_extents_scrubbed

2018-04-02 Thread Gu Jinxiang
Get data_extents_scrubbed value for twice, since there is only one data_extents_scrubbed in struct btrfs_scrub_progress, remove the duplicate one. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- cmds-scrub.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmds-scrub.c b/cmds-s

[PATCH] btrfs-progs: Let function find_device to be consistent with kernel

2018-04-01 Thread Gu Jinxiang
vices") Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- volumes.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/volumes.c b/volumes.c index edad367b..1320b55b 100644 --- a/volumes.c +++ b/volumes.c @@ -54,14 +54,22 @@ static inline

[PATCH] btrfs-progs: Remove unused parameter

2018-03-29 Thread Gu Jinxiang
Parameter usagestr is not used, remove it. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- cmds-filesystem.c | 2 +- help.c| 2 +- help.h| 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 46

[PATCH] btrfs-progs: Do not add extra slash if given path end with it

2018-03-29 Thread Gu Jinxiang
//foo Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- cmds-fi-du.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-fi-du.c b/cmds-fi-du.c index 8a44665c..74f57320 100644 --- a/cmds-fi-du.c +++ b/cmds-fi-du.c @@ -449,7 +449,7 @@ static int du_add_file(cons

RE: [PATCH v5 0/3] Add support for export testsuits

2018-02-08 Thread Gu, Jinxiang
Hi, > -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Friday, February 09, 2018 2:02 AM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org; dste...@suse.cz > Subject: Re: [PATCH v5 0/3] Add support for export te

[PATCH v5 3/3] btrfs-progs: Add readme for export testsuits

2018-02-07 Thread Gu Jinxiang
Add the readme of command for export testsuits. And add the excute method of exported testsuits. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/README.md | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/README.md b/tests/README.md index 04d2ce2a..23

[PATCH v5 1/3] btrfs-progs: Add make testsuite command for export tests

2018-02-07 Thread Gu Jinxiang
no rely on the btrfs's structure. But btrfs-corrupt-block deeply relys on btrfs's structure. For consistency, at the present stage, generete the two when create test tar. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- .gitignore| 1 + Makefile | 4 tests/

[PATCH v5 0/3] Add support for export testsuits

2018-02-07 Thread Gu Jinxiang
rom use EXEC parameter given to run the testsuite to export the testsuite files to a separate tar, run from a script. Gu Jinxiang (3): btrfs-progs: Add make testsuite command for export tests btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests directory and internal binaries btrf

[PATCH v5 2/3] btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests directory and internal binaries

2018-02-07 Thread Gu Jinxiang
Use TEST_TOP for tests directory. And INTERNAL_BIN for internal binaries. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/cli-tests.sh | 15 ++- tests/cli-tests/001-btrfs/test.sh | 2 +- tests/cli-tes

[PATCH 1/3] btrfs-progs: add prerequisite mkfs.btrfs for test-cli

2018-02-07 Thread Gu Jinxiang
Since tests/cli-tests/002-balance-full-no-filters/test.sh need the mkfs.btrfs for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0

[PATCH 3/3] btrfs-progs: add prerequisite btrfs-convert for test-misc

2018-02-07 Thread Gu Jinxiang
Since tests/misc-tests/005-convert-progress-thread-crash/test.sh need the btrfs-convert for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile

[PATCH 2/3] btrfs-progs: add prerequisite btrfs-image for test-fuzz

2018-02-07 Thread Gu Jinxiang
Since tests/fuzz-tests/002-simple-image/test.sh need the btrfs-image for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile

[PATCH v4 3/3] btrfs-progs: Add readme for export testsuits

2018-02-05 Thread Gu Jinxiang
Add the readme of command for export testsuits. And add the excute method of exported testsuits. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/README.md | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/README.md b/tests/README.md index 04d2ce2a..23

[PATCH v4 0/3] Add support for export testsuits

2018-02-05 Thread Gu Jinxiang
arball 5.add temporary file testsuites-id to .gitignore patch3: modify the readme according to the change of patch1. v2->v1: big change of realize idea. from use EXEC parameter given to run the testsuite to export the testsuite files to a separate tar, run from a script. Gu Ji

[PATCH v4 1/3] btrfs-progs: Add make testsuite command for export tests

2018-02-05 Thread Gu Jinxiang
no rely on the btrfs's structure. But btrfs-corrupt-block deeply relys on btrfs's structure. For consistency, at the present stage, generete the two when create test tar. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- .gitignore| 1 + Makefile | 4 tests/

[PATCH v3 0/3] Add support for export testsuits

2018-02-03 Thread Gu Jinxiang
nge of patch1. v2->v1: big change of realize idea. from use EXEC parameter given to run the testsuite to export the testsuite files to a separate tar, run from a script. Gu Jinxiang (3): btrfs-progs: Add make testsuite command for export tests btrfs-progs: Add EXEC represen

[PATCH v3 2/3] btrfs-progs: Add EXEC represent path of executable file

2018-02-03 Thread Gu Jinxiang
Use EXEC instead of TOP to represent the path of excutable file. EXEC is set to TOP by default, but when there is no excutable file in TOP, use the path where btrfs is install as EXEC. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/cli-tests.sh

[PATCH v3 1/3] btrfs-progs: Add make testsuite command for export tests

2018-02-03 Thread Gu Jinxiang
no rely on the btrfs's structure. But btrfs-corrupt-block deeply relys on btrfs's structure. For consistency, at the present stage, generete the two when create test tar. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- .gitignore| 1 + Makefile | 4 tests/

[PATCH v3 3/3] btrfs-progs: Add readme for export testsuits

2018-02-03 Thread Gu Jinxiang
Add the readme of command for export testsuits. And add the excute method of exported testsuits. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/README.md | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/README.md b/tests/README.md index 04d2ce2a..23

RE: [RFC PATCH v2 2/4] btrfs-progs: Add EXEC represent path of executable file

2018-02-03 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Saturday, February 03, 2018 2:08 AM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org; dste...@suse.cz; quwenruo.bt...@gmx.com > Subject: Re: [RFC PATCH v2 2/

RE: [RFC PATCH v2 0/4] Add support for export testsuits

2018-02-03 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of David Sterba > Sent: Saturday, February 03, 2018 2:47 AM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org; dste

RE: [RFC PATCH v2 3/4] btrfs-progs: Modify rootdir files when use mkfs.btrfs

2018-02-03 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Saturday, February 03, 2018 2:11 AM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org; dste...@suse.cz; quwenruo.bt...@gmx.com > Subject: Re: [RFC PATCH v2

[RFC PATCH v2 0/4] Add support for export testsuits

2018-02-02 Thread Gu Jinxiang
tests depend on fssum. 2. after decompress tests.tar.gz, run test by: $ TEST=`MASK` ./mkfs-tests.sh and, without MASK also be ok. replenish: The directory Structure after decompress tests.tar.gz is: $ tar -xzvf ./tests.tar.gz $ ls tests fssum btrfs-corrupt-block Gu Jinxiang (4): btrfs

[RFC PATCH v2 2/4] btrfs-progs: Add EXEC represent path of executable file

2018-02-02 Thread Gu Jinxiang
Use EXEC instead of TOP to represent the path of excutable file. EXEC is set to TOP by default, but when there is no excutable file in TOP, use the path where btrfs is install as EXEC. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/cli-tests.sh

[RFC PATCH v2 4/4] btrfs-progs: Add readme for export testsuits

2018-02-02 Thread Gu Jinxiang
Add the readme of command for export testsuits. And add the excute method of exported testsuits. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/README.md | 20 1 file changed, 20 insertions(+) diff --git a/tests/README.md b/tests/README.md index 04

[RFC PATCH v2 3/4] btrfs-progs: Modify rootdir files when use mkfs.btrfs

2018-02-02 Thread Gu Jinxiang
Since there is no $TOP/Documentation file after package the testsuite. So use a common file that is usually exsits. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- tests/misc-tests/002-uuid-rewrite/test.sh | 4 ++-- tests/misc-tests/003-zero-log/test.sh | 2 +- test

[RFC PATCH v2 1/4] btrfs-progs: Add package command for packaging tests

2018-02-02 Thread Gu Jinxiang
no rely on the btrfs's structure. But btrfs-corrupt-block deeply relys on btrfs's structure. For consistency, at the present stage, generete the two when create test tar. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> --- Makefile | 4 tests/export-tests.s

RE: [PATCH] btrfs: volumes: Cleanup stripe size calculation

2018-01-31 Thread Gu, Jinxiang
tripe_size = min(devices_info[ndevs - 1].max_avail, > + stripe_size); > } > > stripe_size = div_u64(stripe_size, dev_stripes); > -- Reviewed-by: Gu Jinxiang <g...@cn.fujitsu.com> > 2.16.1 > > -- > 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 v3 7/7] btrfs-progs: Cleanup use of root in leaf_data_end

2018-01-30 Thread Gu Jinxiang
ent with leaf_data_end. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> Reviewed-by: Qu Wenruo <w...@suse.com> --- ctree.c | 32 +--- ctree.h | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ctree.c b/ctree.c index 4efc96f..45b368c 100644 ---

[PATCH v3 3/7] btrfs-progs: Sync code with kernel for BTRFS_MAX_INLINE_DATA_SIZE

2018-01-30 Thread Gu Jinxiang
ody to match kernel. v3->v2: Change the title of this commit to make it more exact. Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> Reviewed-by: Qu Wenruo <w...@suse.com> --- convert/source-ext2.c | 2 +- convert/source-reiserfs.c | 2 +- ctree.h | 17 +

[PATCH v3 2/7] btrfs-progs: Use fs_info instead of root for BTRFS_NODEPTRS_PER_BLOCK

2018-01-30 Thread Gu Jinxiang
Do a cleanup. Also make it consistent with kernel. Use fs_info instead of root for BTRFS_NODEPTRS_PER_BLOCK, since maybe in some situation we do not know root, but just know fs_info. Changelog: v2->v1: To be consistent with kernel, change macro to inline function. Signed-off-by: Gu Jinxiang

  1   2   3   >