Re: [PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 13:49, Qu Wenruo wrote: > > > On 2018年02月02日 19:41, Nikolay Borisov wrote: >> >> >> On 2.02.2018 10:19, Qu Wenruo wrote: >>> Just as kernel find_free_dev_extent(), allow it to return maximum hole >>> size for us to build device list for later chunk allocator rework. >>> >>>

Re: [PATCH 25/26] btrfs-progs: deprecate libbtrfs helpers with libbtrfsutil equivalents

2018-02-02 Thread David Sterba
On Fri, Jan 26, 2018 at 10:41:13AM -0800, Omar Sandoval wrote: > From: Omar Sandoval > > The old libbtrfs defines some helpers which do the same thing as some > libbtrfsutil helpers. Reimplement the libbtrfs helpers in terms of the > libbtrfsutil APIs and mark the libbtrfs

[josef-btrfs:current-work 3/3] block/blk-wbt.c:876:10: error: implicit declaration of function 'blkg_lookup_create'; did you mean 'blk_lookup_devt'?

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 1ac686f6d1b04b480cd245fb927180e1238bd3ac [3/3] current-work config: x86_64-randconfig-x005-201804 (attached as .config) compiler: gcc-7 (Debian

[josef-btrfs:current-work 2/3] include/linux/bio.h:521:55: warning: 'struct blkcg_gq' declared inside parameter list will not be visible outside of this definition or declaration

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 4ece201cfafab298cd89083567403a53f0971635 [2/3] block: add bi_blkg to the bio for cgroups config: x86_64-randconfig-x018-201804 (attached as .config)

[josef-btrfs:current-work 2/3] include/linux/bio.h:521:55: warning: 'struct blkcg_gq' declared inside parameter list

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 4ece201cfafab298cd89083567403a53f0971635 [2/3] block: add bi_blkg to the bio for cgroups config: i386-randconfig-a1-201804 (attached as .config)

[josef-btrfs:current-work 3/3] block/blk-wbt.c:866:32: error: 'struct rq_qos' has no member named 'q'

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 1ac686f6d1b04b480cd245fb927180e1238bd3ac [3/3] current-work config: x86_64-randconfig-x008-201804 (attached as .config) compiler: gcc-7 (Debian

Re: [PATCH 4/7] btrfs-progs: Introduce btrfs_raid_array and related infrastructures

2018-02-02 Thread Qu Wenruo
On 2018年02月02日 19:37, Nikolay Borisov wrote: > > > On 2.02.2018 10:19, Qu Wenruo wrote: >> As part of the effort to unify code and behavior between btrfs-progs and >> kernel, copy the btrfs_raid_array from kernel to btrfs-progs. >> >> So later we can use the btrfs_raid_array[] to get needed

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-02-02 Thread Austin S. Hemmelgarn
On 2018-02-01 18:46, Edmund Nadolski wrote: On 02/01/2018 01:12 AM, Anand Jain wrote: On 02/01/2018 01:26 PM, Edmund Nadolski wrote: On 1/31/18 7:36 AM, Anand Jain wrote: On 01/31/2018 09:42 PM, Nikolay Borisov wrote: So usually this should be functionality handled by the raid/san

Re: [RESEND PATCH] btrfs: Fix UAF when cleaning up fs_devs with a single stale device

2018-02-02 Thread David Sterba
On Tue, Jan 30, 2018 at 04:07:37PM +0200, Nikolay Borisov wrote: > Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced > btrfs_free_stale_device which iterates the device lists for all > registered btrfs filesystems and deletes those devices which aren't > mounted. In a btrfs_devices

Re: [PATCH v2] btrfs: Remove btrfs_inode::delayed_iput_count

2018-02-02 Thread David Sterba
On Tue, Jan 16, 2018 at 09:31:58AM +0200, Nikolay Borisov wrote: > delayed_iput_count wa supposed to be used to implement, well, delayed > iput. The idea is that we keep accumulating the number of iputs we do > until eventually the inode is deleted. Turns out we never really > switched the

Re: [PATCH 2/2] btrfs: Remove custom crc32c init code

2018-02-02 Thread David Sterba
On Mon, Jan 08, 2018 at 11:45:05AM +0200, Nikolay Borisov wrote: > The custom crc32 init code was introduced in > 14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to > enable using btrfs as a built-in. However, later as pointed out by > 60efa5eb2e88 ("Btrfs: use late_initcall

Re: [PATCH RESEND 1/4] btrfs: Remove userspace transaction ioctls

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:10PM +0200, Nikolay Borisov wrote: > Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") > marked the beginning of the end of userspace transaction. This commit > finishes the job! > > Signed-off-by: Nikolay Borisov This does

[josef-btrfs:current-work 3/3] block/blk-wbt.c:919:1-10: alloc with no test, possible model on line 924

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 1ac686f6d1b04b480cd245fb927180e1238bd3ac [3/3] current-work coccinelle warnings: (new ones prefixed by >>) >> block/blk-wbt.c:919:1-10: alloc with

Re: [PATCH RESEND 3/4] btrfs: Remove transaction handle from btrfs_file_private

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:12PM +0200, Nikolay Borisov wrote: > Since we no longer support userspace transaction there is no need to > keep this member variable, so remove it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba -- To unsubscribe

Re: [PATCH] btrfs: print error if primary super block write fails

2018-02-02 Thread David Sterba
On Fri, Jan 26, 2018 at 02:47:09PM -0800, Howard McLauchlan wrote: > Presently, failing a primary super block write but succeeding in at > least one super block write in general will appear to users as if > nothing important went wrong. However, upon unmounting and re-mounting, > the file system

Re: [PATCH RESEND 1/4] btrfs: Remove userspace transaction ioctls

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:10PM +0200, Nikolay Borisov wrote: > Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") > marked the beginning of the end of userspace transaction. This commit > finishes the job! > > Signed-off-by: Nikolay Borisov Reviewed-by:

Re: [PATCH RESEND 4/4] btrfs: Remove btrfs_fs_info::open_ioctl_trans

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:13PM +0200, Nikolay Borisov wrote: > Since userspace transaction have been removed we no longer have use > for this field so delete it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba -- To unsubscribe from this

Re: [PATCH] btrfs: Streamline btrfs_delalloc_reserve_metadata initial operations

2018-02-02 Thread David Sterba
On Tue, Jan 30, 2018 at 04:47:54PM +0200, Nikolay Borisov wrote: > On 30.01.2018 16:34, David Sterba wrote: > > On Fri, Jan 12, 2018 at 04:21:05PM +0200, Nikolay Borisov wrote: > >> @@ -6062,19 +6062,19 @@ int btrfs_delalloc_reserve_metadata(struct > >> btrfs_inode *inode, u64 num_bytes) > >>

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

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:03PM +0800, Gu Jinxiang wrote: > 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. What if we just allow to change TOP (ie. do

Re: [PATCH 1/2] libcrc32c: Add crc32c_impl function

2018-02-02 Thread David Sterba
Adding linux-cry...@vger.kernel.org to CC Link to the 2/2 patch https://patchwork.kernel.org/patch/10149203/ On Mon, Jan 08, 2018 at 11:45:04AM +0200, Nikolay Borisov wrote: > This function returns a string with the currently in-use implementation > of the crc32c algorithm, i.e crc32c-generic

Re: [PATCH RESEND 2/4] btrfs: Remove code referencing unused TRANS_USERSPACE

2018-02-02 Thread David Sterba
On Wed, Jan 10, 2018 at 06:32:11PM +0200, Nikolay Borisov wrote: > Now that the userspace transaction ioctls have been removed, > TRANS_USERSPACE is no longer used hence we can remove it. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba >

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

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:04PM +0800, Gu Jinxiang wrote: > 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 > --- > tests/misc-tests/002-uuid-rewrite/test.sh | 4

Re: [PATCH v3] btrfs: print error if primary super block write fails

2018-02-02 Thread Howard McLauchlan
On 02/02/2018 11:09 AM, Howard McLauchlan wrote: > Presently, failing a primary super block write but succeeding in at > least one super block write in general will appear to users as if > nothing important went wrong. However, upon unmounting and re-mounting, > the file system will be in a rolled

Re: [PATCH 2/2] btrfs: Remove custom crc32c init code

2018-02-02 Thread Andy Shevchenko
On Mon, Jan 8, 2018 at 11:45 AM, Nikolay Borisov wrote: > The custom crc32 init code was introduced in > 14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to > enable using btrfs as a built-in. However, later as pointed out by > 60efa5eb2e88 ("Btrfs: use

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

2018-02-02 Thread David Sterba
On Fri, Feb 02, 2018 at 04:34:01PM +0800, Gu Jinxiang wrote: > Achieved: > 1. export testsuit by: > $ make EXPORT=/where/you/want/to/generate/tests.tar.gz package > relative path and absolute path both be ok. > Besides tests itself, fssum and btrfs-corrupt-block will also be > included in

Re: [PATCH 04/26] libbtrfsutil: add btrfs_util_is_subvolume() and btrfs_util_subvolume_id()

2018-02-02 Thread Omar Sandoval
On Thu, Feb 01, 2018 at 05:28:28PM +0100, David Sterba wrote: > On Tue, Jan 30, 2018 at 08:54:08AM +0200, Nikolay Borisov wrote: > > > > > > On 29.01.2018 23:43, Omar Sandoval wrote: > > > On Mon, Jan 29, 2018 at 12:24:26PM +0200, Nikolay Borisov wrote: > > >> On 26.01.2018 20:40, Omar Sandoval

[josef-btrfs:current-work 3/3] block/blk-wbt.h:96:1: sparse: two or more data types in declaration specifiers

2018-02-02 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 1ac686f6d1b04b480cd245fb927180e1238bd3ac commit: 1ac686f6d1b04b480cd245fb927180e1238bd3ac [3/3] current-work reproduce: # apt-get install sparse git checkout

[PATCH v3] btrfs: print error if primary super block write fails

2018-02-02 Thread Howard McLauchlan
Presently, failing a primary super block write but succeeding in at least one super block write in general will appear to users as if nothing important went wrong. However, upon unmounting and re-mounting, the file system will be in a rolled back state. This was discovered with a BCC program that

Re: [PATCH] btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable

2018-02-02 Thread Qu Wenruo
On 2018年01月31日 16:52, Nikolay Borisov wrote: > Currently btrfs_run_qgroups is doing a bit too much. Not only is it > responsible for synchronizing in-memory state of qgroups to disk but > it also contains code to trigger the initial qgroup rescan when > quota is enabled initially. This condition

Re: [PATCH 00/26] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library"

2018-02-02 Thread Hans van Kranenburg
Hi, On 01/26/2018 07:51 PM, Hugo Mills wrote: > On Fri, Jan 26, 2018 at 10:40:48AM -0800, Omar Sandoval wrote: >> From: Omar Sandoval >> >> One of the features requests I get most often is a library to do the >> sorts of operations that we do with btrfs-progs. We can shell out to

Re: [PATCH 21/26] btrfs-progs: use libbtrfsutil for subvol show

2018-02-02 Thread Omar Sandoval
On Sat, Feb 03, 2018 at 12:18:02AM +0100, Hans van Kranenburg wrote: > On 01/26/2018 07:41 PM, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Now implemented with btrfs_util_subvolume_path(), > > btrfs_util_subvolume_info(), and subvolume iterators. > > > > Signed-off-by:

Re: [PATCH 21/26] btrfs-progs: use libbtrfsutil for subvol show

2018-02-02 Thread Hans van Kranenburg
On 01/26/2018 07:41 PM, Omar Sandoval wrote: > From: Omar Sandoval > > Now implemented with btrfs_util_subvolume_path(), > btrfs_util_subvolume_info(), and subvolume iterators. > > Signed-off-by: Omar Sandoval > --- > cmds-subvolume.c | 150 >

Re: [PATCH 3/7] btrfs-progs: Make btrfs_alloc_chunk to handle block group creation

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 10:19, Qu Wenruo wrote: > Before this patch, chunk allocation is split into 2 parts: > > 1) Chunk allocation >Handled by btrfs_alloc_chunk(), which will insert chunk and device >extent items. > > 2) Block group allocation >Handled by btrfs_make_block_group(), which

Re: [PATCH 4/7] btrfs-progs: Introduce btrfs_raid_array and related infrastructures

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 10:19, Qu Wenruo wrote: > As part of the effort to unify code and behavior between btrfs-progs and > kernel, copy the btrfs_raid_array from kernel to btrfs-progs. > > So later we can use the btrfs_raid_array[] to get needed raid info other > than manually do if-else branches. > >

Re: [PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 10:19, Qu Wenruo wrote: > Just as kernel find_free_dev_extent(), allow it to return maximum hole > size for us to build device list for later chunk allocator rework. > > Signed-off-by: Qu Wenruo > --- > volumes.c | 6 +++--- > 1 file changed, 3 insertions(+), 3

Re: [PATCH] btrfs: qgroup: Fix root item corruption when multiple same source snapshiots are created with quota enabled

2018-02-02 Thread Filipe Manana
On Tue, Dec 19, 2017 at 7:44 AM, Qu Wenruo wrote: > When multiple pending snapshots referring the same source subvolume are > executed, enabled quota will cause root item corruption, where root > items are using old bytenr (no backref in extent tree). > > This can be triggered by

Re: [PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size

2018-02-02 Thread Qu Wenruo
On 2018年02月02日 19:41, Nikolay Borisov wrote: > > > On 2.02.2018 10:19, Qu Wenruo wrote: >> Just as kernel find_free_dev_extent(), allow it to return maximum hole >> size for us to build device list for later chunk allocator rework. >> >> Signed-off-by: Qu Wenruo >> --- >>

[PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size

2018-02-02 Thread Qu Wenruo
Just as kernel find_free_dev_extent(), allow it to return maximum hole size for us to build device list for later chunk allocator rework. Signed-off-by: Qu Wenruo --- volumes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/volumes.c b/volumes.c index

[PATCH 7/7] btrfs-progs: volumes: Unify free dev extent search behavior between kernel and btrfs-progs.

2018-02-02 Thread Qu Wenruo
As preparation to create libbtrfs which shares code between kernel and btrfs, this patch mainly unifies the search for free device extents. The main modifications are: 1) Search for free device extent Use the kernel method, by sorting the devices by its max hole capability, and use that

[PATCH 1/7] btrfs-progs: Refactor parameter of BTRFS_MAX_DEVS() from root to fs_info

2018-02-02 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- volumes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/volumes.c b/volumes.c index edad367b593c..677d085de96c 100644 --- a/volumes.c +++ b/volumes.c @@ -826,7 +826,7 @@ error: return ret; } -#define

[PATCH 2/7] btrfs-progs: Merge btrfs_alloc_data_chunk into btrfs_alloc_chunk

2018-02-02 Thread Qu Wenruo
We used to have two chunk allocators, btrfs_alloc_chunk() and btrfs_alloc_data_chunk(), the former is the more generic one, while the later is only used in mkfs and convert, to allocate SINGLE data chunk. Although btrfs_alloc_data_chunk() has some special hacks to cooperate with convert, it's

[PATCH 0/7] Chunk allocator unification

2018-02-02 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/btrfs-progs/tree/libbtrfs_prepare This patchset unified a large part of chunk allocator (free device extent search) between kernel and btrfs-progs. Although there are still differences in the following areas, the goal of

[PATCH 4/7] btrfs-progs: Introduce btrfs_raid_array and related infrastructures

2018-02-02 Thread Qu Wenruo
As part of the effort to unify code and behavior between btrfs-progs and kernel, copy the btrfs_raid_array from kernel to btrfs-progs. So later we can use the btrfs_raid_array[] to get needed raid info other than manually do if-else branches. Signed-off-by: Qu Wenruo --- ctree.h

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

2018-02-02 Thread Gu Jinxiang
Achieved: 1. export testsuit by: $ make EXPORT=/where/you/want/to/generate/tests.tar.gz package relative path and absolute path both be ok. Besides tests itself, fssum and btrfs-corrupt-block will also be included in tests.tar.gz, since misc and fsck tests depend on btrfs-corrupt-block, and misc

[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 --- tests/cli-tests.sh | 5 ++

[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 --- tests/misc-tests/002-uuid-rewrite/test.sh | 4 ++-- tests/misc-tests/003-zero-log/test.sh | 2 +-

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

2018-02-02 Thread Gu Jinxiang
Export the testsuite files to a separate tar. Since fsck tests depend on btrfs-corrupt-block, and misc tests depends on both btrfs-corrupt-block and fssum, so set it as prerequisites for package commad. Because, althougth fssum can be generated by source that are all in tests directory, and has

[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 --- tests/README.md | 20 1 file changed, 20 insertions(+) diff --git a/tests/README.md b/tests/README.md index

[PATCH 01/10] btrfs-progs: copy btrfs_del_orphan_item from kernel

2018-02-02 Thread Lu Fengqi
Add btrfs_del_orphan_item for the later subvolume undelete. Signed-off-by: Lu Fengqi --- ctree.h | 2 ++ inode.c | 30 ++ 2 files changed, 32 insertions(+) diff --git a/ctree.h b/ctree.h index 17cdac76c58c..84bad186a349 100644 ---

[PATCH 03/10] btrfs-progs: use btrfs_find_free_dir_index to find free inode index

2018-02-02 Thread Lu Fengqi
Since we have an existing function to find free inode index, we can reuse it here. Signed-off-by: Lu Fengqi --- inode.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/inode.c b/inode.c index 478036562652..86905365dfd8

[PATCH 00/10] btrfs-progs: introduce btrfs rescue undelete-subvol subcommand

2018-02-02 Thread Lu Fengqi
This command will undelete all subvolumes those are still intact on the device, and all the recovered subvolumes will link with the name "sub" to the lost+found directory. Lu Fengqi (10): btrfs-progs: copy btrfs_del_orphan_item from kernel btrfs-progs: extract btrfs_link_subvol from

[PATCH 04/10] btrfs-progs: undelete-subvol: introduce is_subvol_intact

2018-02-02 Thread Lu Fengqi
The function is used to determine whether the subvolume is intact. Signed-off-by: Lu Fengqi --- Makefile | 3 ++- undelete-subvol.c | 53 + undelete-subvol.h | 17 + 3 files changed, 72

[PATCH 05/10] btrfs-progs: undelete-subvol: introduce recover_dead_root

2018-02-02 Thread Lu Fengqi
The function will find the root_item specified by the subvol_id, clear the BTRFS_ROOT_SUBVOL_DEAD flag and set root_refs to one. Signed-off-by: Lu Fengqi --- ctree.h | 1 + undelete-subvol.c | 55 +++ 2

[PATCH 07/10] btrfs-progs: undelete-subvol: introduce btrfs_undelete_intact_subvols

2018-02-02 Thread Lu Fengqi
The function will traverse the all orphan items on the tree root, and recover the all intact subvolumes. Signed-off-by: Lu Fengqi --- undelete-subvol.c | 60 +++ undelete-subvol.h | 2 ++ 2 files changed, 62

[PATCH 3/7] btrfs-progs: Make btrfs_alloc_chunk to handle block group creation

2018-02-02 Thread Qu Wenruo
Before this patch, chunk allocation is split into 2 parts: 1) Chunk allocation Handled by btrfs_alloc_chunk(), which will insert chunk and device extent items. 2) Block group allocation Handled by btrfs_make_block_group(), which will insert block group item and update space info.

[PATCH 6/7] btrfs-progs: kernel-lib: Port kernel sort() to btrfs-progs

2018-02-02 Thread Qu Wenruo
Used by later btrfs_alloc_chunk() rework. Signed-off-by: Qu Wenruo --- Makefile | 3 +- kernel-lib/sort.c | 104 ++ kernel-lib/sort.h | 16 + 3 files changed, 122 insertions(+), 1 deletion(-) create mode

[PATCH 02/10] btrfs-progs: extract btrfs_link_subvol from btrfs_mksubvol

2018-02-02 Thread Lu Fengqi
The original btrfs_mksubvol is too specific to specify the directory that the subvolume will link to. Furthermore, in this transaction, we don't only need to create root_ref/dir-item, but also update the refs or flags of root_item. Extract a generic btrfs_link_subvol that allow the caller pass a

[PATCH 09/10] btrfs-progs: tests: add testcase for undelete-subvol

2018-02-02 Thread Lu Fengqi
The testcase checks the functionality of "btrfs rescue undelete-subvol", including recovering an intact subvolume, and handling correctly incomplete subvolume. Signed-off-by: Lu Fengqi --- .../029-undelete-subvol/deleted_subvolume.img | Bin 0 -> 4096 bytes

[PATCH 08/10] btrfs-progs: undelete-subvol: add undelete-subvol subcommand

2018-02-02 Thread Lu Fengqi
Add the undelete-subvol subcommand for btrfs rescue. This subcommand is used to recover all deleted subvolume left intact on the device. Signed-off-by: Lu Fengqi --- cmds-rescue.c | 47 +++ 1 file changed, 47 insertions(+)

[PATCH 06/10] btrfs-progs: undelete-subvol: introduce link_subvol_to_lostfound

2018-02-02 Thread Lu Fengqi
The function will create lost+found directory, link the deleted subvolume specified by the subvol_id to the directory, update the information of root_item and cleanup the associated orphan item. Signed-off-by: Lu Fengqi --- undelete-subvol.c | 76

[PATCH 10/10] btrfs-progs: undelete-subvol: update completion and documentation

2018-02-02 Thread Lu Fengqi
Add undelete-subvol to btrfs-completion, and update btrfs-rescue documentation to introduce undelete-subvol. Signed-off-by: Lu Fengqi --- Documentation/btrfs-rescue.asciidoc | 6 ++ btrfs-completion| 2 +- 2 files changed, 7 insertions(+), 1

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-02-02 Thread Edmund Nadolski
On 02/01/2018 01:12 AM, Anand Jain wrote: > > > On 02/01/2018 01:26 PM, Edmund Nadolski wrote: >> On 1/31/18 7:36 AM, Anand Jain wrote: >>> >>> >>> On 01/31/2018 09:42 PM, Nikolay Borisov wrote: >>> >>> >> So usually this should be functionality handled by the raid/san >> controller I

Re: Writeback errors in kernel log with Linux 4.15 (m=s=raid1, d=raid5, 5 disks)

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 03:28, Janos Toth F. wrote: > I started seeing these on my d=raid5 filesystem after upgrading to Linux 4.15. > > Some files created since the upgrade seem to be corrupted. > > The disks seem to be fine (according to btrfs device stats and > smartmontools device logs). > > The

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

2018-02-02 Thread Nikolay Borisov
On 2.02.2018 10:34, Gu Jinxiang wrote: > Achieved: > 1. export testsuit by: > $ make EXPORT=/where/you/want/to/generate/tests.tar.gz package > relative path and absolute path both be ok. > Besides tests itself, fssum and btrfs-corrupt-block will also be > included in tests.tar.gz, since misc

Re: [PATCH 2/7] btrfs-progs: Merge btrfs_alloc_data_chunk into btrfs_alloc_chunk

2018-02-02 Thread Su Yue
On 02/02/2018 04:19 PM, Qu Wenruo wrote: We used to have two chunk allocators, btrfs_alloc_chunk() and btrfs_alloc_data_chunk(), the former is the more generic one, while the later is only used in mkfs and convert, to allocate SINGLE data chunk. Although btrfs_alloc_data_chunk() has some

Re: [PATCH 2/7] btrfs-progs: Merge btrfs_alloc_data_chunk into btrfs_alloc_chunk

2018-02-02 Thread Qu Wenruo
On 2018年02月02日 17:20, Su Yue wrote: > > > On 02/02/2018 04:19 PM, Qu Wenruo wrote: >> We used to have two chunk allocators, btrfs_alloc_chunk() and >> btrfs_alloc_data_chunk(), the former is the more generic one, while the >> later is only used in mkfs and convert, to allocate SINGLE data

Re: [PATCH 2/7] btrfs-progs: Merge btrfs_alloc_data_chunk into btrfs_alloc_chunk

2018-02-02 Thread Su Yue
On 02/02/2018 05:41 PM, Qu Wenruo wrote: On 2018年02月02日 17:20, Su Yue wrote: On 02/02/2018 04:19 PM, Qu Wenruo wrote: We used to have two chunk allocators, btrfs_alloc_chunk() and btrfs_alloc_data_chunk(), the former is the more generic one, while the later is only used in mkfs and

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

2018-02-02 Thread Qu Wenruo
On 2018年02月02日 18:41, Nikolay Borisov wrote: > > > On 2.02.2018 10:34, Gu Jinxiang wrote: >> Achieved: >> 1. export testsuit by: >> $ make EXPORT=/where/you/want/to/generate/tests.tar.gz package >> relative path and absolute path both be ok. >> Besides tests itself, fssum and