Signed-off-by: Qu Wenruo
---
tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh
b/tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh
index 3928f548c3f9..4bbcfbae662e 100755
--- a/
Strangely, we have level check in btrfs_print_tree() while we don't have
the same check in read_node_slot().
That's to say, for the following corruption, btrfs_search_slot() or
btrfs_next_leaf() can return invalid leaf:
Parent eb:
node XX level 1
^^^
Child sh
Currently the function uses a hardcoded value for the checksum size of
a sector. This is fine, given that we currently support only a single
algorithm, whose checksum is 4 bytes == sizeof(u32). Despite not
having other algorithms, btrfs' design supports using a different
algorithm whith different s
Please ignore this one.
I just forgot to remove unrelated patch.
Thanks,
Qu
On 2018年02月07日 17:17, Qu Wenruo wrote:
> Signed-off-by: Qu Wenruo
> ---
> tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/fsck-tests/028-unaligne
On 2018年02月07日 17:19, Nikolay Borisov wrote:
> Currently the function uses a hardcoded value for the checksum size of
> a sector. This is fine, given that we currently support only a single
> algorithm, whose checksum is 4 bytes == sizeof(u32). Despite not
> having other algorithms, btrfs' design
On 02/07/2018 05:19 PM, Nikolay Borisov wrote:
Currently the function uses a hardcoded value for the checksum size of
a sector. This is fine, given that we currently support only a single
algorithm, whose checksum is 4 bytes == sizeof(u32). Despite not
having other algorithms, btrfs' design sup
The colon is meaningless so remove it.
Signed-off-by: Su Yue
---
tests/common | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/common b/tests/common
index 8e5d0cde1b7e..7f641a004661 100644
--- a/tests/common
+++ b/tests/common
@@ -331,7 +331,7 @@ extract_image()
From: Filipe Manana
When doing an incremental send of a filesystem with the no-holes feature
enabled, we end up issuing a write operation when using the no data mode
send flag, instead of issuing an update extent operation. Fix this by
issuing the update extent operation instead.
Trivial reprodu
From: Filipe Manana
When we truncate a file to the same size and that size is not aligned
with the sector size, we end up triggering writeback (and wait for it to
complete) of the last page. This is unncessary as we can not have delayed
allocation beyond the inode's i_size and the goal of truncat
From: Filipe Manana
When send finishes processing an inode representing a regular file, it
always issues a truncate operation for that file, even if its size did
not change or the last write sets the file size correctly. In the most
common cases, the issued write operations set the file to correc
On Wed, Feb 07, 2018 at 05:57:43PM +0800, Su Yue wrote:
> The colon is meaningless so remove it.
>
> Signed-off-by: Su Yue
Applied, thanks.
--
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
On Wed, Feb 07, 2018 at 05:18:25PM +0800, Qu Wenruo wrote:
> Strangely, we have level check in btrfs_print_tree() while we don't have
> the same check in read_node_slot().
>
> That's to say, for the following corruption, btrfs_search_slot() or
> btrfs_next_leaf() can return invalid leaf:
>
> Pare
On 2018年02月07日 22:35, David Sterba wrote:
> On Wed, Feb 07, 2018 at 05:18:25PM +0800, Qu Wenruo wrote:
>> Strangely, we have level check in btrfs_print_tree() while we don't have
>> the same check in read_node_slot().
>>
>> That's to say, for the following corruption, btrfs_search_slot() or
>> bt
btrfs_write_and_wait_transaction is essentially a wrapper of
btrfs_write_and_wait_marked_extents with the addition of calling
clear_btree_io_tree. Having the code split doesn't really bring any
benefit. Open code the later into the former and add proper
documentation header.
Signed-off-by: Nikolay
Here are a bunch of transaction-related cleanups all of them present no
functional changes. The first 2 patches could be more interesting - the first
one moves trans_release_metadata to transaction.c and makes it static and the
second one opencodes btrfs_write_and_wait_marked_extents in its sole
We already have the fs_info from the passed transaction so use it
directly. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index b8fd9fe8a9
We already pass btrfs_trans_handle which contains a reference to the
fs_info so use that. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
in
We already pass the btrfs_transaction which references fs_info so no
need to pass the later as an argument. Also use the opportunity to
shorten transaction->trans. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 2 +-
fs/btrfs/volumes.c | 10 +-
fs/
The only thing the passed root is used for is:
1. get a reference to the fs_info and to
2. call trace_btrfs_transaction_commit.
We can achieve 1) by simply referring to the fs_info from passed trans
object. As far as 2) is concerned cleanup_transaction is called from
only one place and the 'root'
We already pass the transaction handle which has a reference to the
fs_info. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index f24f05fb5
This function is only ever used in __btrfs_end_transaction and
btrfs_commit_transaction so there is no need to export it via header.
Let's move it closer to where it's used, make it static and remove it
from the header. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/ctree.h
We already pass the transaction which has a reference to the fs_info,
so use that. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/delayed-inode.c | 6 ++
fs/btrfs/delayed-inode.h | 6 ++
fs/btrfs/extent-tree.c | 2 +-
fs/btrfs/transaction.c | 8
fs/btr
It can be referenced from the passed transaction so no point in passing
it as a function argument. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/ctree.h | 3 +--
fs/btrfs/extent-tree.c | 4 ++--
fs/btrfs/transaction.c | 2 +-
3 files changed, 4 insertions(+), 5 deletion
We already pass a transaction handle which refrences the fs_info so
we can grab it from there. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction
We already pass the trans handle which has a reference to fs_info to
create_pending_snapshot so we can refer to it directly. Doing this
obviates the need to pass the fs_info to create_pending_snapshots as
well. No functional changes.
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 10
We already pass the transactino handle, which contains a refrence to
the fs_info so grab it from there. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/delayed-inode.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrf
It can be referenced from the passed transaciton so no point in
passing it as function argument. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/ctree.h | 3 +--
fs/btrfs/extent-tree.c | 10 +-
fs/btrfs/transaction.c | 6 +++---
3 files changed, 9 insertions(+),
All current callers of this function just get a reference to the
trans->fs_info member and pass it as the second argument. Collapse this
into the function itself. No functional changes
Signed-off-by: Nikolay Borisov
---
fs/btrfs/transaction.c | 14 --
1 file changed, 8 insertions(+),
On Tue, Feb 06, 2018 at 01:37:24PM +0800, Gu Jinxiang wrote:
> Use TEST_TOP for tests/common, Documentation, images, and internal
> binaries.
Well, the point of TEST_TOP was also to remove the /tests/ subdirectory
from the paths if it's inside git and to set it to the top directory
where the expor
Hello,
I have encountered what I think is a problem with btrfs, which causes
my file server to become unresponsive. But let‘s start with the basic
information:
uname -a = Linux mars 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2
(2018-01-04) x86_64 GNU/Linux
btrfs –version = btrfs-progs v4.7.3
L
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git
current-work
head: 71fe7e0ab249e42c17f387951aa09de7cb362d35
commit: 71fe7e0ab249e42c17f387951aa09de7cb362d35 [3/3] current-work
config: i386-randconfig-x010-201805 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git
current-work
head: 71fe7e0ab249e42c17f387951aa09de7cb362d35
commit: 71fe7e0ab249e42c17f387951aa09de7cb362d35 [3/3] current-work
config: x86_64-randconfig-x008-201805 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1
Strangely, we have level check in btrfs_print_tree() while we don't have
the same check in read_node_slot().
That's to say, for the following corruption, btrfs_search_slot() or
btrfs_next_leaf() can return invalid leaf:
Parent eb:
node XX level 1
^^^
Child sh
Hi all,
I have successfully restored a snapshot of root but now when I try to
make a new snapshot I get this error:
IO Error (.snapshots is not a btrfs subvolume).
My snapshots were within @ which I renamed to @_old.
What can I do now? How can I move the snapshots from @_old/ into @ and
be able to
On Tue, Feb 06, 2018 at 09:28:14AM +0800, Qu Wenruo wrote:
>
>
> On 2018年02月06日 07:15, Liu Bo wrote:
> > Btrfs tries its best to tolerate write errors, but kind of silently
> > (except some messages in kernel log).
> >
> > For raid1 and raid10, this is usually not a problem because there is a
>
On 2018年02月08日 06:57, Liu Bo wrote:
> On Tue, Feb 06, 2018 at 09:28:14AM +0800, Qu Wenruo wrote:
>>
>>
>> On 2018年02月06日 07:15, Liu Bo wrote:
>>> Btrfs tries its best to tolerate write errors, but kind of silently
>>> (except some messages in kernel log).
>>>
>>> For raid1 and raid10, this is usu
On Wed, Feb 7, 2018 at 12:57 PM, Stefan Malte Schumacher <
s.schumac...@netcologne.de> wrote:
>
>
> Feb 5 21:25:12 mars kernel: [250116.605471] Node 0 active_anon:176kB
> inactive_anon:276kB active_file:14228752kB inactive_file:1631728kB
> unevictable:0kB isolated(anon):0kB isolated(file):4096kB m
On Wed, Feb 7, 2018 at 6:26 PM, Nick Gilmour wrote:
> Hi all,
>
> I have successfully restored a snapshot of root but now when I try to
> make a new snapshot I get this error:
> IO Error (.snapshots is not a btrfs subvolume).
> My snapshots were within @ which I renamed to @_old.
> What can I do n
Another way to test for this problem is one of the responses in that
lkml thread by Btrfs list regular Duncan, about tweaking the knobs
that handle dirty write caching. So you could try those suggested
tweaks first, rather than changing kernels.
https://lkml.org/lkml/2016/12/13/753
Chris Murphy
In repair_extent_data_item(), path is not be released if some
errors occurs which causes extent buffer leak.
So release path in end of the function.
Reviewed-by: Qu Wenruo
Signed-off-by: Su Yue
---
check/mode-lowmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/check/mode-lowmem.c b/ch
In lowmem mode with '--repair', check_chunks_and_extents_v2()
will fix accounting in block groups and clear the error
bit BG_ACCOUNTING_ERROR.
However, return value of check_btrfs_root() doesn't contain error bits.
If extent tree is on error, lowmem repair always prints error and
returns nonzero v
This patchset can be fetched from my github:
https://github.com/Damenly/btrfs-progs/tree/lowmem
based on unmerged patchset whose cover:
[PATCH 0/3] btrfs-progs: Split original mode check to its own
Author: Qu Wenruo
I'm sorry to send patches based on unmerged patch if it let you
Commit d17d6663c99c ("btrfs-progs: lowmem check: Fix regression which
screws up extent allocator") removes pin_metadata_blocks() from
lowmem repair.
So we have to find another way to exclude extents which should be
occupied by tree blocks.
Introduce exclude_metadata_blocks() to mark extents of all
The variable @eb is assigned to leaf in fs_tree before insertion of
backref. It will causes wrong parent of new inserted backref.
Set @parent at beginning solves the problem.
Reviewed-by: Qu Wenruo
Signed-off-by: Su Yue
---
check/mode-lowmem.c | 10 +-
1 file changed, 5 insertions(+),
Another global u64 last_allocated_chunk records the last chunk start
allocated by lowmem repair.
Although global variable is not so graceful, it simplifies codes much.
avoid_extents_overwrite() prefer to allocates new chunk first.
If it failed because of no space or wrong used bytes(fsck-tests/004
This new image only misses one extent which leads lowmem mode to
allocate new chunk in repair.
Original image renamed to no_extent_bad_dev.img should let lowmem mode
exclude blocks in repair.
Due to problems of btrfs-image, choose xz as compression tool.
Signed-off-by: Su Yue
---
tests/fsck-tes
If options '--init-extent-tree' and '--mode=lowmem' are both
input, all metadata blocks will be traversed twice.
First one is done by pin_metadata_blocks() in reinit_extent_tree().
Second one is in check_chunks_and_extents_v2().
Excluding instead of pining metadata blocks before reinit extent tree
Since extents can be avoid overwrite by excluding or new chunk
allocation. It's unnessesary to do all repairs in one transaction.
This patch removes parameter @trans of repair_extent_data_item().
repair_extent_data_item() calls try_avoid_extents_overwrite()
and starts a transaction by itself.
Not
This patch removes the parameter @trans of delete_extent_item().
It calls try_avoid_extents_overwrite() and starts a transaction by itself.
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear aft
This patch removes parameter @trans of check_leaf_items().
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear after removing @trans finished.
Signed-off-by: Su Yue
---
check/mode-lowmem.c | 5
This patch removes parameter @trans of repair_chunk_item().
It calls try_avoid_extents_overwrite() and starts a transaction by
itself.
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear after re
Introduce create_chunk_and_block_block_group() to allocate new chunk
and corresponding block group.
The new function force_cow_in_new_chunk() first allocates new chunk
and records its start.
Then it modifies all metadata block groups cached and full.
Finally it marks the new block group uncached a
This patch removes parameter @trans of repair_tree_back_ref().
It calls try_avoid_extents_overwrite() and starts a transaction by
itself.
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear after
Remove @trans in check_chunks_and_extents().
This patch let lowmem repair work again.
Signed-off-by: Su Yue
---
check/mode-lowmem.c | 13 -
1 file changed, 13 deletions(-)
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 40a179f75319..4aad69fc9eb1 100644
--- a/check/mod
Remove parameters @trans of delete_extent_item() and walk_down_tree_v2().
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear after removing @trans finished.
Signed-off-by: Su Yue
---
check/mo
Excluding or pining all metadata blocks is not time-efficient for large
storage filesystems.
Here is another way to mark all metadata block groups full and allocate
a new chunk for CoW. So new reservered extents never overwrite
extents.
Introduce modify_block_groups_cache() to modify all blocks gr
Introduce repair_block_accounting() which calls
btrfs_fix_block_accounting() to repair block group accouting.
Replace btrfs_fix_block_accounting() with the new function.
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction"
This patch removes parameter @trans of repair_extent_item().
It calls try_avoid_extents_overwrite() and starts a transaction by
itself.
Note: This patch and next patches cause error in lowmem repair like:
"Error: Commit_root already set when starting transaction".
This error will disappear after r
08.02.2018 06:03, Chris Murphy пишет:
> On Wed, Feb 7, 2018 at 6:26 PM, Nick Gilmour wrote:
>> Hi all,
>>
>> I have successfully restored a snapshot of root but now when I try to
How exactly was it done?
>> make a new snapshot I get this error:
>> IO Error (.snapshots is not a btrfs subvolume).
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
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 034c943..9299411 100644
---
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
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 00e2137..034c943 100644
--- a/M
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
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9299411..7ccba62 1006
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
Achieved:
1. export testsuite by:
$ make testsuite
files list in testsuites-list will be added into tarball
btrfs-progs-tests.tar.gz.
2. after decompress btrfs-progs-tests.tar.gz, run test by:
$ TEST=`MASK` ./tests/mkfs-tests.sh
and, without MASK also be ok.
replenish:
$ tar -xzvf ./btrfs-prog
Use TEST_TOP for tests directory.
And INTERNAL_BIN for internal binaries.
Signed-off-by: Gu Jinxiang
---
tests/cli-tests.sh | 15 ++-
tests/cli-tests/001-btrfs/test.sh | 2 +-
tests/cli-tests/002-balance-full-no-filters/test
Add the readme of command for export testsuits.
And add the excute method of exported testsuits.
Signed-off-by: Gu Jinxiang
---
tests/README.md | 13 +
1 file changed, 13 insertions(+)
diff --git a/tests/README.md b/tests/README.md
index 04d2ce2a..23f35cfc 100644
--- a/tests/README.
ping ?
Thanks, Anand
--
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
On 8.02.2018 02:59, Qu Wenruo wrote:
> Strangely, we have level check in btrfs_print_tree() while we don't have
> the same check in read_node_slot().
>
> That's to say, for the following corruption, btrfs_search_slot() or
> btrfs_next_leaf() can return invalid leaf:
>
> Parent eb:
> node XXX
On 7.02.2018 21:57, Stefan Malte Schumacher wrote:
> Hello,
>
>
> I have encountered what I think is a problem with btrfs, which causes
> my file server to become unresponsive. But let‘s start with the basic
> information:
>
> uname -a = Linux mars 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2
69 matches
Mail list logo