Use simple struct operation instead of address calculation.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 46 ++
1 files changed, 14 insertions(+), 32 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index
.
Thanks
Zhaolei
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/extent_io.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index bdfbfa6..3194c79 100644
, but with
the existing code the calculation is only done when there is an IO
error.
We could use a check for num_copies == 0 before calling the calc
function.
-chris
Hello, chris
I'll modify this patch to read num_copies only in IO error.
Thanks
Zhaolei
Signed-off-by: Zhao Lei zhao
:(PAGE_CACHE_SIZE - 1);
inode.c:~(PAGE_CACHE_SIZE - 1);
inode.c:if ((end (PAGE_CACHE_SIZE - 1)) == 0)
Thanks
Zhaolei
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
3: Delete above file
4: Wait about 100s to let chunk removed
5: goto 2
Script
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
3: Delete above file
4: Wait about 100s to let chunk removed
5: goto 2
Script
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
3: Delete above file
4: Wait about 100s to let chunk removed
5: goto 2
Script
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
3: Delete above file
4: Wait about 100s to let chunk removed
5: goto 2
Script
From: Zhao Lei zhao...@cn.fujitsu.com
int alloc_chunk is never used in this function, remove it.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
int alloc_chunk is never used in this function, remove it.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
The code are similar, combine them to make code clean and easy to maintenance.
Some lost condition are also completed with benefit of this combination.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index
From: Zhao Lei zhao...@cn.fujitsu.com
refs is better than ref_count to record a struct's ref count.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Suggested-by: David Sterba dste...@suse.cz
---
fs/btrfs/scrub.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
From: Zhao Lei zhao...@cn.fujitsu.com
if (sctx-is_dev_replace !is_metadata !have_csum) {
...
goto nodatasum_case;
}
...
nodatasum_case:
WARN_ON(sctx-is_dev_replace);
In above code, nodatasum_case marker should be moved after
WARN_ON().
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
It is always 1 in this place, because !1 case was already jumped
out in previous code.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/scrub.c | 19 +++
1 file changed, 7
From: Zhao Lei zhao...@cn.fujitsu.com
Corrent code use many kinds of clever way to determine operation
target's raid type, as:
raid_map != NULL
or
raid_map[MAX_NR] == RAID[56]_Q_STRIPE
To make code easy to maintenance, this patch put raid type into
bbio, and we can always get raid type
From: Zhao Lei zhao...@cn.fujitsu.com
So we can check raid56 with:
(map-type BTRFS_BLOCK_GROUP_RAID56_MASK)
instead of long:
(map-type (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6))
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Sterba dste...@suse.cz
3: bbio-ref_count - bbio-refs
Suggested by: David Sterba dste...@suse.cz
4: all ref_count - refs in other code(new PATCH 16/16)
Suggested by: David Sterba dste...@suse.cz
Many thanks for above people for review these patch.
Thanks
Zhaolei
Zhao Lei (15):
Btrfs: fix a out
From: Zhao Lei zhao...@cn.fujitsu.com
scrub_setup_recheck_block() have many arguments but most of them
can be get from one of them, we can remove them to make code clean.
Some other cleanup for that function also included in this patch.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
From: Zhao Lei zhao...@cn.fujitsu.com
We add the number of stripes on target devices into bbio-num_stripes
if we are under device replacement, and we just sort the raid_map of
those stripes that not on the target devices, so if when we need
real raid_map, we need skip the stripes on the target
From: Zhao Lei zhao...@cn.fujitsu.com
It can make code more simple and clear, we need not care about
free bbio and raid_map together.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 77
From: Zhao Lei zhao...@cn.fujitsu.com
1: ref_count is simple than current RBIO_HOLD_BBIO_MAP_BIT flag
to keep btrfs_bio's memory in raid56 recovery implement.
2: free function for bbio will make code clean and flexible, plus
forced data type checking in compile.
Changelog v1-v2:
Rename
From: Zhao Lei zhao...@cn.fujitsu.com
It can avoid complex calculation of real stripes in sort,
moreover, we can clean up code of sorting tgtdev_map because it
will be in order initially.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
1: ref_count is simple than current RBIO_HOLD_BBIO_MAP_BIT flag
to keep btrfs_bio's memory in raid56 recovery implement.
2: free function for bbio will make code clean and flexible, plus
forced data type checking in compile.
Changelog v1-v2:
Rename
From: Zhao Lei zhao...@cn.fujitsu.com
It can avoid complex calculation of real stripes in sort,
moreover, we can clean up code of sorting tgtdev_map because it
will be in order initially.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
Current code of page level repair for dev-replace can only support
io-error, we can't use it in checksum-fail case.
We can skip this kind of repair in dev-replace just as we in scrub.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie
From: Zhao Lei zhao...@cn.fujitsu.com
if (sctx-is_dev_replace !is_metadata !have_csum) {
...
goto nodatasum_case;
}
...
nodatasum_case:
WARN_ON(sctx-is_dev_replace);
In above code, nodatasum_case marker should be moved after
WARN_ON().
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
It is always 1 in this place, because !1 case was already jumped
out in previous code.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/scrub.c | 19 +++
1 file changed, 7
From: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index
)
Suggested by: David Sterba dste...@suse.cz
Many thanks for above people for review these patch.
Thanks
Zhaolei
Zhao Lei (16):
Btrfs: fix a out-of-bound access of raid_map
Btrfs: sort raid_map before adding tgtdev stripes
Btrfs: Make raid_map array be inlined in btrfs_bio structure
Btrfs
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove no-need DEFINE_WAIT(wait)
2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
3: Use while loop instead of goto
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 12
From: Zhao Lei zhao...@cn.fujitsu.com
Corrent code use many kinds of clever way to determine operation
target's raid type, as:
raid_map != NULL
or
raid_map[MAX_NR] == RAID[56]_Q_STRIPE
To make code easy to maintenance, this patch put raid type into
bbio, and we can always get raid type
From: Zhao Lei zhao...@cn.fujitsu.com
We add the number of stripes on target devices into bbio-num_stripes
if we are under device replacement, and we just sort the raid_map of
those stripes that not on the target devices, so if when we need
real raid_map, we need skip the stripes on the target
From: Zhao Lei zhao...@cn.fujitsu.com
scrub_setup_recheck_block() have many arguments but most of them
can be get from one of them, we can remove them to make code clean.
Some other cleanup for that function also included in this patch.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
From: Zhao Lei zhao...@cn.fujitsu.com
It can make code more simple and clear, we need not care about
free bbio and raid_map together.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 77
From: Zhao Lei zhao...@cn.fujitsu.com
The code are similar, combine them to make code clean and easy to maintenance.
Some lost condition are also completed with benefit of this combination.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove unused DEFINE_WAIT(wait)
2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
3: Use a loop instead of goto
Changelog v1-v2:
s/look/loop in description.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 12
From: Zhao Lei zhao...@cn.fujitsu.com
If we have any chance to make a successful write, we should not give up.
This patch adjust commit-transaction condition from:
pinned = wanted
to
left + pinned = wanted
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 3 ++-
1
From: Zhao Lei zhao...@cn.fujitsu.com
If we have any chance to make a successful write, we should not give up.
This patch adjust commit-transaction condition from:
pinned = wanted
to
left + pinned = wanted
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 3 ++-
1
From: Zhao Lei zhao...@cn.fujitsu.com
It is always 1 in this place, because !1 case was already jumped
out in previous code.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/scrub.c | 19 +++
1 file changed, 7
From: Zhao Lei zhao...@cn.fujitsu.com
if (sctx-is_dev_replace !is_metadata !have_csum) {
...
goto nodatasum_case;
}
...
nodatasum_case:
WARN_ON(sctx-is_dev_replace);
In above code, nodatasum_case marker should be moved after
WARN_ON().
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
1: ref_count is simple than current RBIO_HOLD_BBIO_MAP_BIT flag
to keep btrfs_bio's memory in raid56 recovery implement.
2: free function for bbio will make code clean and flexible, plus
forced data type checking in compile.
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
It can make code more simple and clear, we need not care about
free bbio and raid_map together.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 77
From: Zhao Lei zhao...@cn.fujitsu.com
Use break instead of useless loop should be more suitable in this
case.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Zhao Lei zhao...@cn.fujitsu.com
In corrent code, code of finding-right-mirror and writing-to-target
are mixed in logic, if we find a right mirror but failed in writing
to target, it will treat as hadn't found right block, and fill the
target with sblock_bad.
Actually, failed in writing to
From: Zhao Lei zhao...@cn.fujitsu.com
Current code of page level repair for dev-replace can only support
io-error, we can't use it in checksum-fail case.
We can skip this kind of repair in dev-replace just as we in scrub.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie
From: Zhao Lei zhao...@cn.fujitsu.com
It can avoid complex calculation of real stripes in sort,
moreover, we can clean up code of sorting tgtdev_map because it
will be in order initially.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
So we can check raid56 with:
(map-type BTRFS_BLOCK_GROUP_RAID56_MASK)
instead of long:
(map-type (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6))
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
The code are similar, combine them to make code clean and easy to maintenance.
Some lost condition are also completed with benefit of this combination.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
From: Zhao Lei zhao...@cn.fujitsu.com
scrub_setup_recheck_block() have many arguments but most of them
can be get from one of them, we can remove them to make code clean.
Some other cleanup for that function also included in this patch.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
From: Zhao Lei zhao...@cn.fujitsu.com
Corrent code use many kinds of clever way to determine operation
target's raid type, as:
raid_map != NULL
or
raid_map[MAX_NR] == RAID[56]_Q_STRIPE
To make code easy to maintenance, this patch put raid type into
bbio, and we can always get raid type
From: Zhao Lei zhao...@cn.fujitsu.com
We add the number of stripes on target devices into bbio-num_stripes
if we are under device replacement, and we just sort the raid_map of
those stripes that not on the target devices, so if when we need
real raid_map, we need skip the stripes on the target
From: Zhao Lei zhao...@cn.fujitsu.com
Hi, everyone,
These are cleanup patchs for raid56's scrib functions, it is based on review
for new-developed raid56's scrub code.
Some small typo-fix and cleanup for other functions are also included in
this patchset.
Thanks
Zhaolei
Zhao Lei (15):
Btrfs
From: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove no-need DEFINE_WAIT(wait)
2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
3: Use while loop instead of goto
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 12
From: Zhao Lei zhao...@cn.fujitsu.com
Old code bypass commit transaction when we don't have enough
pinned space, but another case is there exist freed bgs in current
transction, it have possibility to make alloc_chunk success.
This patch modify the condition to:
if (have_free_bg ||
From: Zhao Lei zhao...@cn.fujitsu.com
Remove int alloc_chunk in btrfs_check_data_free_space()
for not necessary.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times,
and we can't write to filesystem until mount it again.
Steps to reproduce:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times,
and we can't write to filesystem until mount it again.
Steps to reproduce:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
From: Zhao Lei zhao...@cn.fujitsu.com
There functions include unused chunk_tree argument from the begining,
it is time to remove them and clean up relative code to prepare value
of this argument in caller.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/volumes.c | 20
From: Zhao Lei zhao...@cn.fujitsu.com
Btrfs will report NO_SPACE when we create and remove files for several times,
and we can't write to filesystem until mount it again.
Steps to reproduce:
1: Create a single-dev btrfs fs with default option
2: Write a file into it to take up most fs space
From: Zhao Lei zhao...@cn.fujitsu.com
wait_event() is just suit for these hand-made code.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove unused DEFINE_WAIT(wait)
2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
3: Use a look instead of goto
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 12 ++--
1 file changed, 6 insertions(+), 6
From: Zhao Lei zhao...@cn.fujitsu.com
for() is obviously better in these code block, and remove noused
init-value to reduce about 6 bytes binary size.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/volumes.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
From: Zhao Lei zhao...@cn.fujitsu.com
for() is obviously better in these code block, and remove noused
init-value to reduce about 6 bytes binary size.
Reviewed-by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/volumes.c | 9 +++--
1 file changed, 3
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove unused DEFINE_WAIT(wait)
2: Use a look instead of goto
Changelog v1-v2:
Remove likely() in v1 because it is not a performance sensitive path,
suggesed by: David Sterba dste...@suse.cz
Acked-by: David Sterba dste...@suse.cz
Signed-off-by: Zhao
From: Zhao Lei zhao...@cn.fujitsu.com
wait_event() is just suit for these hand-made code.
Reviewed-by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git
From: Zhao Lei zhao...@cn.fujitsu.com
for() is obviously better in these code block, and remove noused
init-value to reduce about 6 bytes binary size.
Reviewed-by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/volumes.c | 9 +++--
1 file changed, 3
From: Zhao Lei zhao...@cn.fujitsu.com
1: Remove unused DEFINE_WAIT(wait)
2: Use a loop instead of goto
Changelog v2-v3:
s/look/loop in description.
Changelog v1-v2:
Remove likely() in v1 because it is not a performance sensitive path,
suggesed by: David Sterba dste...@suse.cz
Acked-by:
From: Zhao Lei zhao...@cn.fujitsu.com
wait_event() is just suit for these hand-made code.
Reviewed-by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git
From: Zhao Lei zhao...@cn.fujitsu.com
It is another reason of NO_SPACE bug.
When we found enough free space in loop and saved them to
max_hole_start/size before, and tail space contains pending extent,
origional innocent max_hole_start/size data are reset in retry.
As a result,
From: Zhao Lei zhao...@cn.fujitsu.com
btrfs will report no_space when we run following write and delete
file loop:
# FILE_SIZE_M=[ 75% of fs space ]
# DEV=[ some dev ]
# MNT=[ some dir ]
#
# mkfs.btrfs -f $DEV
# mount -o nodatacow $DEV $MNT
# for ((i = 0; i 100; i++)); do dd if=/dev/zero
From: Zhao Lei zhao...@cn.fujitsu.com
This is another fix of no_space case.
All patchs for fix no_space bug are available at fix_no_space
branch on:
git://github.com/zhaoleidd/btrfs
Any suggestions are welcome.
Zhao Lei (1):
btrfs: wait for delayed iputs on no space
From: Zhao Lei zhao...@cn.fujitsu.com
Reproduce:
while true; do
dd if=/dev/zero of=/mnt/btrfs/file count=[75% fs_size]
rm /mnt/btrfs/file
done
Then we can see above loop failed on NO_SPACE.
It it long-term problem since very beginning, because delayed-iput
after rm are not run.
We
From: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 2285e78..c087870 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1464,7 +1464,6 @@
From: Zhao Lei zhao...@cn.fujitsu.com
Current code is trying to calculate rbio-dbitmap's size to make it
align to sizeof(long), but implement haven't achived this object,
it is align to sizeof(char) instead.
This patch fixed above calculation, and use sizeof(long) instead of
fixed 8 to increate
From: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 0d902ac..0a40d07 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1049,6 +1049,7 @@
From: Zhao Lei zhao...@cn.fujitsu.com
We can use rbio-stripe_npages to reduce unnecessary calculation in
many code place.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git
From: Zhao Lei zhao...@cn.fujitsu.com
We are using different index calculation method for stripe_page in
current code:
1: (rbio-stripe_len / PAGE_CACHE_SIZE) * stripe_index + page_index
2: DIV_ROUND_UP(rbio-stripe_len, PAGE_CACHE_SIZE) * stripe_index + page_index
3: DIV_ROUND_UP(rbio-stripe_len *
From: Zhao Lei zhao...@cn.fujitsu.com
No need to create additional end_io function for scrub, it can use
existing raid_write_end_io() instead.
This patch also fixed some wrong comments.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/raid56.c | 36
From: Zhao Lei zhao...@cn.fujitsu.com
Above BUG_ON() was triggered only one time in my test, but hadn't
happened again in same env.
The reason maybe:
A block group which include pinned space was removed before
unpin_extent_range(), and no other block_group_cache after
start pos, so the code
From: Zhao Lei zhao...@cn.fujitsu.com
Bug1:
space_info-bytes_readonly was set to very large(negative) value in
btrfs_remove_block_group().
Reason:
Current code set block_group_cache-pinned = 0 in btrfs_delete_unused_bgs(),
but above space was not counted to space_info-bytes_readonly.
From: Zhao Lei zhao...@cn.fujitsu.com
space_info's value calculation is some complex and easy to cause
bug, add WARN_ON() to help debug.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 8
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
It is the last patch to fix following write fail case:
while true; do
write a file to 75% fs size
delete above file
sync or sleep
done
Above issue is caused by several reason, and fixed in following patch
respectively:
Btrfs: fix
From: Zhao Lei zhao...@cn.fujitsu.com
Steps to reproduce:
while true; do
dd if=/dev/zero of=/btrfs_dir/file count=[fs_size * 75%]
rm /btrfs_dir/file
sync
done
And we'll see dd failed because btrfs return NO_SPACE.
Reason:
Normally, btrfs_commit_transaction() call
From: Zhao Lei zhao...@cn.fujitsu.com
Changelog v1-v2:
[PATCH 2/2] btrfs: add WARN_ON() to check is space_info op current
Put WARN_ON()s under the ENOSPC_DEBUG mount option.
Suggested by: David Sterba dste...@suse.cz
Changelog v1-v2:
drop patch of:
Remove BUG_ON() when failed searching
From: Zhao Lei zhao...@cn.fujitsu.com
Bug1:
space_info-bytes_readonly was set to very large(negative) value in
btrfs_remove_block_group().
Reason:
Current code set block_group_cache-pinned = 0 in btrfs_delete_unused_bgs(),
but above space was not counted to space_info-bytes_readonly.
From: Zhao Lei zhao...@cn.fujitsu.com
space_info's value calculation is some complex and easy to cause
bug, add WARN_ON() to help debug.
Changelog v1-v2:
Put WARN_ON()s under the ENOSPC_DEBUG mount option.
Suggested by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
space_info's value calculation is some complex and easy to cause
bug, add WARN_ON() to help debug.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 8
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
Bug1:
space_info-bytes_readonly was set to very large(negative) value in
btrfs_remove_block_group().
Reason:
Current code set block_group_cache-pinned = 0 in btrfs_delete_unused_bgs(),
but above space was not counted to space_info-bytes_readonly.
From: Zhao Lei zhao...@cn.fujitsu.com
Changelog v1-v2:
drop patch of:
Remove BUG_ON() when failed searching block_group_cache in
unpin_extent_range()
because Filipe Manana fdman...@suse.com already fixed it with
better way.
Zhao Lei (2):
btrfs: Set relative data on clear
From: Zhao Lei zhao...@cn.fujitsu.com
If we have any chance to make a successful write, we should not give up.
This patch adjust commit-transaction condition from:
pinned = wanted
to
left + pinned = wanted
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 3 ++-
1
From: Zhao Lei zhao...@cn.fujitsu.com
space_info's value calculation is some complex and easy to cause
bug, add WARN_ON() to help debug.
Changelog v1-v2:
Put WARN_ON()s under the ENOSPC_DEBUG mount option.
Suggested by: David Sterba dste...@suse.cz
Signed-off-by: Zhao Lei
From: Zhao Lei zhao...@cn.fujitsu.com
Reproduce:
while true; do
dd if=/dev/zero of=/mnt/btrfs/file count=[75% fs_size]
rm /mnt/btrfs/file
done
Then we can see above loop failed on NO_SPACE.
It it long-term problem since very beginning, because delayed-iput
after rm are not run.
We
From: Zhao Lei zhao...@cn.fujitsu.com
Bug1:
space_info-bytes_readonly was set to very large(negative) value in
btrfs_remove_block_group().
Reason:
Current code set block_group_cache-pinned = 0 in btrfs_delete_unused_bgs(),
but above space was not counted to space_info-bytes_readonly.
From: Zhao Lei zhao...@cn.fujitsu.com
Old code bypass commit transaction when we don't have enough
pinned space, but another case is there exist freed bgs in current
transction, it have possibility to make alloc_chunk success.
This patch modify the condition to:
if (have_free_bg ||
From: Zhao Lei zhao...@cn.fujitsu.com
Remove int alloc_chunk in btrfs_check_data_free_space() for not
necessary.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c
From: Zhao Lei zhao...@cn.fujitsu.com
btrfs will report no_space when we run following write and delete
file loop:
# FILE_SIZE_M=[ 75% of fs space ]
# DEV=[ some dev ]
# MNT=[ some dir ]
#
# mkfs.btrfs -f $DEV
# mount -o nodatacow $DEV $MNT
# for ((i = 0; i 100; i++)); do dd if=/dev/zero
From: Zhao Lei zhao...@cn.fujitsu.com
It is another reason for NO_SPACE case.
When we found enough free space in loop and saved them to
max_hole_start/size before, and tail space contains pending extent,
origional innocent max_hole_start/size are reset in retry.
As a result,
From: Zhao Lei zhao...@cn.fujitsu.com
Steps to reproduce:
while true; do
dd if=/dev/zero of=/btrfs_dir/file count=[fs_size * 75%]
rm /btrfs_dir/file
sync
done
And we'll see dd failed because btrfs return NO_SPACE.
Reason:
Normally, btrfs_commit_transaction() call
1 - 100 of 173 matches
Mail list logo