-by: Qu Wenruo
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs/delayed-ref.c | 53 +-
fs/btrfs/delayed-ref.h | 15
2 files changed, 52 insertions(+), 16 deletions(-)
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
From: Wang Xiaoguang
Add ordered-extent support for dedupe.
Note, current ordered-extent support only supports non-compressed source
extent.
Support for compressed source extent will be added later.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
---
fs/btrfs
From: Wang Xiaoguang
Unlike in-memory or on-disk dedupe method, only SHA256 hash method is
supported yet, so implement btrfs_dedupe_calc_hash() interface using
SHA256.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs
This patchset can be fetched from github:
https://github.com/littleroad/linux.git dedupe_latest
Now the new base is v4.20-rc1.
Normal test cases from auto group exposes no regression, and ib-dedupe
group can pass without problem.
xfstests ib-dedupe group can be fetched from github:
https://githu
From: Wang Xiaoguang
Introduce static function inmem_add() to add hash into in-memory tree.
And now we can implement the btrfs_dedupe_add() interface.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c | 150
From: Wang Xiaoguang
Introduce the header for btrfs in-band(write time) de-duplication
framework and needed header.
The new de-duplication framework is going to support 2 different dedupe
methods and 1 dedupe hash.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Signed-off-by: Lu
only normal 128M extent size is supported. More types will
follow soon.
Signed-off-by: Wang Xiaoguang
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
fs/btrfs/ctree.h | 43 ++---
fs/btrfs/extent-tree.c | 48 ---
fs/btrfs/file.c
possible race.
Cc: Mark Fasheh
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c | 131 +++---
1 file changed, 125 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/dedupe.c b/fs/btrfs/dedupe.c
index
--block-size 64k /mnt
# btrfs dedupe enable --force --limit-hash 1m /mnt
Will reset blocksize to default value:
dedupe blocksize: 128K << reset
dedupe hash limit nr: 1m
Suggested-by: David Sterba
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c
implement restore all dedupe hash in memory rb-tree, with LRU
behavior to control the limit.
Signed-off-by: Wang Xiaoguang
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
fs/btrfs/ctree.h | 4 +-
fs/btrfs/dedupe.h | 15 ++
fs/btrfs/extent-tree.c | 31 +++-
fs/btrfs/extent_io.c
From: Wang Xiaoguang
Add generic function to initialize dedupe info.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs/Makefile | 2 +-
fs/btrfs/dedupe.c | 169 +
fs
alue will be (0).
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c | 50 ++
fs/btrfs/dedupe.h | 17 +---
fs/btrfs/disk-io.c | 3 ++
fs/btrfs/ioctl.c | 85 +++
e the returned -ENOENT in relocate_tree_block() and continue
balancing.
Reported-by: Satoru Takeuchi
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
fs/btrfs/relocation.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrf
-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c | 210 +-
1 file changed, 209 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/dedupe.c b/fs/btrfs/dedupe.c
index 951fefd19fde
From: Qu Wenruo
Add status subcommand for dedupe command group.
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
Documentation/btrfs-dedupe-inband.asciidoc | 3 +
btrfs-completion | 2 +-
cmds-dedupe-ib.c | 80
Patchset can be fetched from github:
https://github.com/littleroad/btrfs-progs.git dedupe_latest
Inband dedupe(in-memory backend only) ioctl support for btrfs-progs.
v7 changes:
Update ctree.h to follow kernel structure change
Update print-tree to follow kernel structure change
V8 changes:
From: Qu Wenruo
Introduce reconfigure subcommand to co-operate with new kernel ioctl
modification.
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
Documentation/btrfs-dedupe-inband.asciidoc | 7 +++
btrfs-completion | 2 +-
cmds-dedupe-ib.c
From: Qu Wenruo
Add enable subcommand for dedupe commmand group.
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
Documentation/btrfs-dedupe-inband.asciidoc | 114 +-
btrfs-completion | 6 +-
cmds-dedupe-ib.c | 238
From: Qu Wenruo
Add disable subcommand for dedupe command group.
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
Documentation/btrfs-dedupe-inband.asciidoc | 5 +++
btrfs-completion | 2 +-
cmds-dedupe-ib.c | 41
From: Qu Wenruo
Add basic ioctl header and command group framework for later use.
Alone with basic man page doc.
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
Documentation/Makefile.in | 1 +
Documentation/btrfs-dedupe-inband.asciidoc | 40
On Tue, Nov 13, 2018 at 02:45:45PM +0100, David Sterba wrote:
>On Tue, Nov 06, 2018 at 02:41:09PM +0800, Lu Fengqi wrote:
>> This patchset can be fetched from github:
>> https://github.com/littleroad/linux.git dedupe_latest
>>
>> Now the new base is v4.20-rc1.
>
&g
: 1f265fc6f58b ("btrfs: harden agaist duplicate fsid on scanned devices")
Signed-off-by: Lu Fengqi
---
fs/btrfs/volumes.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2186300bab91..6039ae5c549e 100644
--- a/fs/btrfs/volum
On Wed, Nov 14, 2018 at 05:05:48PM +0100, David Sterba wrote:
>On Wed, Nov 14, 2018 at 03:24:56PM +0800, Lu Fengqi wrote:
>> =
>> WARNING: suspicious RCU usage
>> 4.20.0-rc2+ #23 Tainted: G O
>>
cleanup work to
>cleanup_extent_op so it can be used by check_ref_cleanup() in order to
>unify the extent op handling.
>
>Signed-off-by: Josef Bacik
One nitpick below.
Reviewed-by: Lu Fengqi
>---
> fs/btrfs/extent-tree.c | 36 +++-
> 1 file cha
The generic/513 tell that cloning into a file did not strip security
privileges (suid, capabilities) like a regular write would.
Signed-off-by: Lu Fengqi
---
The xfs and ocfs2 call generic_remap_file_range_prep to drop file
privileges, I'm not sure whether btrfs should do the same thing.
The @found is always false when it comes to the if branch. Besides, the
bool type is more suitable for @found.
Signed-off-by: Lu Fengqi
---
fs/btrfs/extent_io.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index
When it is introduced at commit f094ac32aba3 ("Btrfs: fix NULL pointer
after aborting a transaction"), it's useless.
Signed-off-by: Lu Fengqi
---
fs/btrfs/transaction.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
ind
The generic_write_checks will check the combination of IOCB_NOWAIT and
!IOCB_DIRECT.
Signed-off-by: Lu Fengqi
---
fs/btrfs/file.c | 4
1 file changed, 4 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 3835bb8c146d..190db9a685a2 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs
On Wed, Nov 28, 2018 at 09:48:07AM +0200, Nikolay Borisov wrote:
>
>
>On 28.11.18 г. 9:46 ч., Christoph Hellwig wrote:
>> On Wed, Nov 28, 2018 at 09:44:59AM +0200, Nikolay Borisov wrote:
>>>
>>>
>>> On 28.11.18 г. 5:07 ч., Lu Fengqi wrote:
>>>>
On Wed, Nov 28, 2018 at 09:01:42AM +0200, Nikolay Borisov wrote:
>
>
>On 28.11.18 г. 5:21 ч., Lu Fengqi wrote:
>> The @found is always false when it comes to the if branch. Besides, the
>> bool type is more suitable for @found.
>
>Well if you are ranging the type of f
The @found is always false when it comes to the if branch. Besides, the
bool type is more suitable for @found. Change the return value of the
function and its caller to bool as well.
Signed-off-by: Lu Fengqi
---
fs/btrfs/extent_io.c | 31 +++
fs/btrfs
ocow
path")
Signed-off-by: Lu Fengqi
---
fs/btrfs/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d54bdef16d8d..9c5e9629eb6c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1369,7 +1369,8 @@ stat
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 insertions(+), 1 deletion
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 files changed, 56 insertions
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 insertions(+)
diff --git a
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
--- a/ctree.h
+++ b/ctree.h
@@ -2784,6
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 100644
--- a/inode.c
+++ b
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_s
ass a
trans argument for later subvolume undelete.
No functional changes for the btrfs_mksubvol.
Signed-off-by: Lu Fengqi
---
convert/main.c | 57 +
ctree.h| 5 +++--
inode.c| 46 +---
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
.../029-un
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(+)
diff --git a/cmds-rescue.c
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
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 deletion(-)
diff --git a
Instead of the disk_bytenr and disk_num_bytes of the extent_item which the
file extent references, we should output the objectid and offset of the
file extent.
Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data
backref in extent tree")
Signed-off-by: Lu Fengqi
("btrfs-progs: check: introduce function to check data
backref in extent tree")
Signed-off-by: Lu Fengqi
---
V2: Output the objectid of the root and the owner of the leaf.
check/mode-lowmem.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/check/mode-lowmem
ile11
btrfs subvolume snapshot $mnt $mnt/snap1
umount $mnt
btrfs-image -c9 $dev extent_data_ref.img
--
Signed-off-by: Lu Fengqi
---
.../fsck-tests/020-extent-ref-cases/extent_data_ref.img | Bin 0 -> 6144 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 tests/f
(file offset - extent offset).
What caused the false alert is the code mix up the owner root objectid and
the file tree objectid.
Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data
backref in extent tree")
Signed-off-by: Lu Fengqi
---
check/mode-lowmem.c | 4 ++
Because of commit e76e13ce8c0b ("fsstress: implement the
clonerange/deduperange ioctls"), dedupe makes the number of references to
the same extent item increase so much that the default 4K buffer of
logical-resolve is no longer sufficient.
Signed-off-by: Lu Fengqi
---
tests/btrfs/004
In the case of compression, each 128K input data chunk will be compressed
to 4K (because of the characters written are duplicate). Therefore we have
to write (128K * 16) to make sure every stripe can be hit.
Signed-off-by: Lu Fengqi
---
tests/btrfs/146 | 11 +--
1 file changed, 9
In the case of compression, each 128K input data chunk will be compressed
to 4K (because of the characters written are duplicate). Therefore we have
to write (128K * 16) to make sure every stripe can be hit.
Signed-off-by: Lu Fengqi
---
V2: Modify the regular expression to ensure that it
On Thu, Mar 08, 2018 at 02:10:59PM +0800, Eryu Guan wrote:
>On Thu, Mar 08, 2018 at 01:56:45PM +0800, Lu Fengqi wrote:
>> In the case of compression, each 128K input data chunk will be compressed
>> to 4K (because of the characters written are duplicate). Therefore we have
>>
In the case of compression, each 128K input data chunk will be compressed
to 4K (because of the characters written are duplicate). Therefore we have
to write (128K * 16) to make sure every stripe can be hit.
Signed-off-by: Lu Fengqi
---
V3: Write ($number_of_devices * 2048)K data unconditionally
On Wed, Mar 14, 2018 at 09:32:50AM +0800, Qu Wenruo wrote:
>
>
>On 2018年03月14日 02:47, fdman...@kernel.org wrote:
>> From: Filipe Manana
>>
>> Under some cases the filesystem checker reports an error when it finds
>> checksum items for an extent that is referenced by an inode as a prealloc
>> exte
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 files changed, 56 insertions
ume which will be
recovered.
The first six patches are not modified.
7th-8th add the -s option to specify subvol_id instead of recovering all
subvolumes.
9th add shell quoting to test script.
10th just add the -s option documentation.
Lu Fengqi (10):
btrfs-progs: copy btrfs_del_orphan_item from ker
Add undelete-subvol to btrfs-completion, and update btrfs-rescue
documentation to introduce undelete-subvol.
Signed-off-by: Lu Fengqi
---
v2: just add -s option documentation.
Documentation/btrfs-rescue.asciidoc | 12
btrfs-completion| 2 +-
2 files changed
ass a
trans argument for later subvolume undelete.
No functional changes for the btrfs_mksubvol.
Signed-off-by: Lu Fengqi
---
convert/main.c | 57 +
ctree.h| 5 +++--
inode.c| 46 +---
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
The function default will traverse the all orphan items on the tree root,
and recover the all intact subvolumes. If subvol_id is specified, then only
the corresponding subvolume will be recovered.
Signed-off-by: Lu Fengqi
---
v2: add subvol_id argumenta to specify subvol_id instead of recovering
Add the undelete-subvol subcommand for btrfs rescue. This subcommand is
used to recover deleted subvolume left intact on the device.
Signed-off-by: Lu Fengqi
---
v2: add -s option to specify subvol_id.
cmds-rescue.c | 70 +++
1 file
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 fa861ba0b4c3..0fc31dd8d998 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2793,6
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 insertions(+), 1 deletion
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 100644
--- a/inode.c
+++ b
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
---
v2: add shell quoting to test script.
.../030-undelete-subvol/deleted_subvolume.img | Bin
Modify cscope/ctags rule to include directories such as check/
libbtrfsutil/kernel-lib/kernel-shared.
Signed-off-by: Lu Fengqi
---
Makefile | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 6065522a615f..8afc8f6ed6a3 100644
--- a/Makefile
s-progs: Unify btrfs_leaf_free_psace() parameter with kernel
> btrfs-progs: print-tree: Remove btrfs_root parameter
The patchset looks good to me.
Reviewed-by: Lu Fengqi
>
> btrfs-corrupt-block.c | 2 +-
> check/main.c | 2 +-
> check/mode-lowmem.c | 2 +-
btrfs-progs
>
>Please note that, although function btrfs_print_tree() is not called by
>anyone right now, it's still a pretty useful function to debug kernel.
>So that function is still kept for later use.
>
>Signed-off-by: Qu Wenruo
Looks good to me.
Reviewed-by: Lu Fe
Since the out label has been deleted, this free_extent_buffer will never
be executed.
Fixes: f37ae8d275c2 ("btrfs-progs: print-tree: Enhance warning on tree block
level mismatch and error handling")
Signed-off-by: Lu Fengqi
---
print-tree.c | 2 --
1 file changed, 2 deletions(-)
di
On Tue, Mar 27, 2018 at 03:06:48PM +0800, Lu Fengqi wrote:
>This patchset will add undelete-subvol subcommand for btrfs rescue. This
>enhancement allows undeleting a subvolume on an unmounted filesystem.
Gentle ping.
Any advice about this patchset will be welcomed.
--
Thanks,
Lu
>
On Wed, Apr 18, 2018 at 01:02:43PM +0800, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
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
On Wed, Apr 18, 2018 at 01:12:10PM +0800, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
The function is used to determine whether the subvolume is intact.
Signed-off-by: Lu Fengqi
---
Makefile | 3 ++-
undelete-subvol.c | 53
On Wed, Apr 18, 2018 at 01:16:55PM +0800, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
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.
Sorry I didn't point it out in btrfs_link_subvol() patch, b
On 04/18/2018 01:21 PM, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
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
On Wed, Apr 18, 2018 at 01:28:23PM +0800, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
The function default will traverse the all orphan items on the tree root,
and recover the all intact subvolumes. If subvol_id is specified, then only
the corresponding subvolume will be recovered
On 04/18/2018 01:32 PM, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
Add the undelete-subvol subcommand for btrfs rescue. This subcommand is
used to recover deleted subvolume left intact on the device.
Signed-off-by: Lu Fengqi
---
v2: add -s option to specify subvol_id.
cmds
On 04/18/2018 01:42 PM, Qu Wenruo wrote:
On 2018年03月27日 15:06, Lu Fengqi wrote:
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
---
v2: add she
Add the undelete-subvol subcommand for btrfs rescue. This subcommand is
used to recover deleted subvolume left intact on the device.
Signed-off-by: Lu Fengqi
---
V3: remove OPEN_CTREE_PARTIAL flag.
V2: add -s option to specify subvol_id.
cmds-rescue.c | 69
The function default will traverse the all orphan items on the tree root,
and recover the all intact subvolumes. If subvol_id is specified, then only
the corresponding subvolume will be recovered.
Signed-off-by: Lu Fengqi
---
V3:
pass btrfs_fs_info instead of btrfs_root;
rename
.
The first patch are not modified.
For the rest, please see the changelog in the patches.
Lu Fengqi (10):
btrfs-progs: copy btrfs_del_orphan_item from kernel
btrfs-progs: extract btrfs_link_subvol from btrfs_mksubvol
btrfs-progs: use btrfs_find_free_dir_index to find free inode index
btrfs
The function will find the root_item specified by the subvol_id
and clear the BTRFS_ROOT_SUBVOL_DEAD flag.
Signed-off-by: Lu Fengqi
---
V3:
remove btrfs_root argument;
don't modify root_refs.
ctree.h | 1 +
undelete-subvol.c | 51 +
Since we have an existing function to find free inode index, we can
reuse it here.
Signed-off-by: Lu Fengqi
Reviewed-by: Qu Wenruo
---
V3: add Reviewed-by from Qu Wenruo.
inode.c | 27 +++
1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/inode.c b/inode.c
trans
argument for later subvolume undelete. And rename the original
btrfs_mksubvol to link_subvol_for_convert since it is a less generic
btrfs_link_subvol.
No functional changes.
Signed-off-by: Lu Fengqi
---
V3:
rename the btrfs_mksubvol to link_subvol_for_convert;
remove the redundant parameter co
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 1fef37c93485..46a1dbfd2f27 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2796,6
The function is used to determine whether the subvolume is intact.
Signed-off-by: Lu Fengqi
---
V3:
add SPDX-License-Identifier;
pass btrfs_fs_info instead of btrfs_root;
use btrfs_read_fs_root instead of manually search;
remove empty header file.
Makefile | 3 ++-
undelete-subvol.c
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
---
V3:
rename testcase to 031-undelete-subvol;
rename images and add image description to test.s
Add undelete-subvol to btrfs-completion, and update btrfs-rescue
documentation to introduce undelete-subvol.
Signed-off-by: Lu Fengqi
---
V2: just add -s option documentation.
Documentation/btrfs-rescue.asciidoc | 12
btrfs-completion| 2 +-
2 files changed
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
Reviewed-by: Qu Wenruo
---
V3:
pass btrfs_fs_info instead of btrfs_root
parameters is wrong and causes qgroup show to output the wrong
qgroup parent-child relationship.
Fixes: aaf2dac5ef37 ("btrfs-progs: qgroup: split update_qgroup to reduce
arguments")
Issue: #129
Signed-off-by: Lu Fengqi
---
qgroup.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletion
On Tue, Nov 28, 2017 at 07:48:28PM +0100, David Sterba wrote:
>On Mon, Nov 27, 2017 at 05:41:56PM +0800, Lu Fengqi wrote:
>> As we all know, under certain circumstances, it is more appropriate to
>> create some subvolumes rather than keep everything in the same
>> subvolume
Show the absolute subvol path for the associated level-0 qgroup.
Signed-off-by: Lu Fengqi
---
Changelog:
v2:
rebase on the qgroup cleanup
qgroup.c | 111 +++
qgroup.h | 1 +
2 files changed, 106 insertions(+), 6 deletions(-)
diff
The first two patches are the rest of the qgroup cleanup, the two
remaining patches add show path feature.
Lu Fengqi (4):
btrfs-progs: qgroup: move btrfs_show_qgroups's error handler to
__qgroup_search
btrfs-progs: qgroup: cleanup __qgroup_search
btrfs-progs: qgroup: show subvol
in this routine has been reported, so we don't need to
report again in cmd_qgroup_show.
Signed-off-by: Lu Fengqi
---
cmds-qgroup.c | 4
qgroup.c | 14 --
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 38382ea9..d07
Replace the if statement with the switch statement, and return the
appropriate value for the future use rather than directly exit.
Signed-off-by: Lu Fengqi
---
Changelog:
v2:
1. revoke incorrect goto pattern
2. split the error handler movement to another patch
qgroup.c | 48
You may want to sort qgroup with the subvol path, now you can use
--sort=path.
Signed-off-by: Lu Fengqi
---
Changelog:
v2:
rebase on the qgroup cleanup
Documentation/btrfs-qgroup.asciidoc | 2 +-
cmds-qgroup.c | 2 +-
qgroup.c| 22
3): outstanding_extents = 1023 reserved_extents = 1023
And in Step 5) we reserve correct amount of metadata space.
Signed-off-by: Wang Xiaoguang
Signed-off-by: Qu Wenruo
Signed-off-by: Lu Fengqi
---
fs/btrfs/ctree.h | 2 ++
fs/btrfs/extent-tree.c | 2 ++
fs/btrfs/extent_io.c | 7 +++--
fs/
From: Wang Xiaoguang
Add ordered-extent support for dedupe.
Note, current ordered-extent support only supports non-compressed source
extent.
Support for compressed source extent will be added later.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
---
fs/btrfs
-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs/btrfs/dedupe.c | 189 ++
1 file changed, 189 insertions(+)
diff --git a/fs/btrfs/dedupe.c b/fs/btrfs/dedupe.c
index 762960edb251
From: Qu Wenruo
For in-band dedupe, btrfs needs to increase data ref with delayed_ref
locked, so add a new function btrfs_add_delayed_data_ref_lock() to
increase extent ref with delayed_refs already locked.
Signed-off-by: Qu Wenruo
Reviewed-by: Josef Bacik
Signed-off-by: Lu Fengqi
---
fs
From: Qu Wenruo
Since the introduction of btrfs dedupe tree, it's possible that balance can
race with dedupe disabling.
When this happens, dedupe_enabled will make btrfs_get_fs_root() return
PTR_ERR(-ENOENT).
But due to a bug in error handling branch, when this happens
backref_cache->nr_nodes is
From: Wang Xiaoguang
Introduce static function inmem_add() to add hash into in-memory tree.
And now we can implement the btrfs_dedupe_add() interface.
Signed-off-by: Qu Wenruo
Signed-off-by: Wang Xiaoguang
Reviewed-by: Josef Bacik
---
fs/btrfs/dedupe.c | 151 +
1 - 100 of 496 matches
Mail list logo