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.
How
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 100644 kernel-lib/s
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 BTRFS_MAX_DEVS(r) ((BTRFS_LEA
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 quit
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
extr
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 | 12
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 b47ff1f392b5..f40
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 sor
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(-)
cr
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/undelet
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/i
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 btrfs_mksu
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
tr
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-undelete-subvol/drop_prog
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 b
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/Docu
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 +-
tests/mkfs-tests/004-rootdir-keeps-
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 no
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 04d2ce2a..9f4c01ac 100644
--- a/tests/
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 t
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 ++
tests/cli-tests/001-
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 speci
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 res
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 g
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 chunk
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 conver
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 btrfs-corrupt-bl
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 an
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 wil
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.
>
>
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 deletions(-)
>
>
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 fstests btrfs/152
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
>> ---
>> volumes.c | 6 +++--
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 ra
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.
>>>
>>> Signe
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
con
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)
c
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 versions as deprecated,
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 7.2.0-1
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)
compi
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 7.2.0-1
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 st
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 wi
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)
> >>
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 delayed_
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 n
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 (fo
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 instea
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 list: send the line "unsubscribe linux-b
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: David Sterba
--
To
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 from this list: send the line "unsubs
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
> -struct btrfs_trans_handle *btrfs_start_ioc
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 not compile without th
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 no
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 ++--
> tests/misc-tests
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 tests.ta
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 u
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 w
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
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 late_initcall instead of mod
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 1ac686f6d1b04b480cd245fb92
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
>> btrfs-progs,
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
> --
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: Omar Sandoval
>
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
68 matches
Mail list logo