Re: [PATCH] Btrfs: fix extent buffer bitmap tests on big-endian systems

2016-07-13 Thread Feifei Xu
On 2016/7/13 7:21, Omar Sandoval wrote: From: Omar Sandoval The in-memory bitmap code manipulates words and is therefore sensitive to endianness, while the extent buffer bitmap code addresses bytes and is byte-order agnostic. Because the byte addressing of the extent buffer

Re: [PATCH V2 0/8] Btrfs: self-tests: Support non-4k page size

2016-06-01 Thread Feifei Xu
On 2016/6/1 23:51, Feifei Xu wrote: Hi, Btrfs self-test module assumed that both sectorsize and PAGE_SIZE are 4K. Thus many self-tests fail on non-4K page size systems, like ppc64. This patchset enables self-tests to be executed on non-4k page size systems. This patchset enables us to easily

[PATCH V2 5/8] Btrfs: self-tests: Support testing all possible sectorsizes and nodesizes

2016-06-01 Thread Feifei Xu
To test all possible sectorsizes, this commit adds a sectorsize array. This commit executes the tests for all possible sectorsizes and nodesizes. Signed-off-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/

[PATCH V2 2/8] Btrfs: Fix integer overflow when calculating bytes_per_bitmap

2016-06-01 Thread Feifei Xu
On ppc64, bytes_per_bitmap will be (65536*8*65536). Hence append UL to fix integer overflow. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 12 ++-- fs/btrfs/test

[PATCH V2 6/8] Btrfs: self-tests: Use macros instead of constants and add missing newline

2016-06-01 Thread Feifei Xu
This commit replaces numerical constants with appropriate preprocessor macros. Signed-off-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/tests/extent-buffer-tests.c

[PATCH V2 8/8] Btrfs: self-tests: Fix extent buffer bitmap test fail on BE system

2016-06-01 Thread Feifei Xu
while test_bit() reads in unsigned long granularity. Hence we end up comparing wrong bits on big-endian systems such as ppc64. This commit fixes the issue by reading the bitmap in byte granularity. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu

[PATCH V2 1/8] Btrfs: test_check_exists: Fix infinite loop when searching for free space entries

2016-06-01 Thread Feifei Xu
s patch fixes the issue by checking the "tmp" variable which point to the most recently searched free space node. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 4 ++-- 1 file ch

[PATCH V2 3/8] Btrfs: self-tests: Support non-4k page size

2016-06-01 Thread Feifei Xu
self-tests code assumes 4k as the sectorsize and nodesize. This commit fix hardcoded 4K. Enables the self-tests code to be executed on non-4k page sized systems (e.g. ppc64). Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> Signed-off-by: Chandan Rajendra <chan...@linux.vne

[PATCH V2 0/8] Btrfs: self-tests: Support non-4k page size

2016-06-01 Thread Feifei Xu
at separate all change that are not related to hardcoded 4096/sectorsize/PAGE_SIZE. 3) fix some coding style issue - Feifei Xu (8): Btrfs: test_check_exists: Fix infinite loop when searching for free space entries Btrfs: Fix integer overflow when calculating bytes_per_bitmap Btrfs: self-test

[PATCH V2 7/8] Btrfs: self-tests: Fix test_bitmaps fail on 64k sectorsize

2016-06-01 Thread Feifei Xu
With 64K sectorsize, 1G sized block group cannot span across bitmaps. To execute test_bitmaps() function, this commit allocates "BITS_PER_BITMAP * sectorsize + PAGE_SIZE" sized block group. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by:

[PATCH V2 4/8] Btrfs: self-tests: Execute page straddling test only when nodesize < PAGE_SIZE

2016-06-01 Thread Feifei Xu
On ppc64, PAGE_SIZE is 64k which is same as BTRFS_MAX_METADATA_BLOCKSIZE. In such a scenario, we will never be able to have an extent buffer containing more than one page. Hence in such cases this commit does not execute the page straddling tests. Signed-off-by: Feifei Xu <xu

[PATCH V2 4/8] Btrfs: self-tests: Execute page straddling test only when nodesize < PAGE_SIZE

2016-06-01 Thread Feifei Xu
On ppc64, PAGE_SIZE is 64k which is same as BTRFS_MAX_METADATA_BLOCKSIZE. In such a scenario, we will never be able to have an extent buffer containing more than one page. Hence in such cases this commit does not execute the page straddling tests. Signed-off-by: Feifei Xu <xu

[PATCH V2 3/8] Btrfs: self-tests: Support non-4k page size

2016-06-01 Thread Feifei Xu
self-tests code assumes 4k as the sectorsize and nodesize. This commit fix hardcoded 4K. Enables the self-tests code to be executed on non-4k page sized systems (e.g. ppc64). Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> Signed-off-by: Chandan Rajendra <chan...@linux.vne

[PATCH V2 5/8] Btrfs: self-tests: Support testing all possible sectorsizes and nodesizes

2016-06-01 Thread Feifei Xu
To test all possible sectorsizes, this commit adds a sectorsize array. This commit executes the tests for all possible sectorsizes and nodesizes. Signed-off-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/

[PATCH V2 8/8] Btrfs: self-tests: Fix extent buffer bitmap test fail on BE system

2016-06-01 Thread Feifei Xu
while test_bit() reads in unsigned long granularity. Hence we end up comparing wrong bits on big-endian systems such as ppc64. This commit fixes the issue by reading the bitmap in byte granularity. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu

[PATCH V2 7/8] Btrfs: self-tests: Fix test_bitmaps fail on 64k sectorsize

2016-06-01 Thread Feifei Xu
With 64K sectorsize, 1G sized block group cannot span across bitmaps. To execute test_bitmaps() function, this commit allocates "BITS_PER_BITMAP * sectorsize + PAGE_SIZE" sized block group. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by:

[PATCH V2 6/8] Btrfs: self-tests: Use macros instead of constants and add missing newline

2016-06-01 Thread Feifei Xu
This commit replaces numerical constants with appropriate preprocessor macros. Signed-off-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/tests/extent-buffer-tests.c

[PATCH V2 2/8] Btrfs: Fix integer overflow when calculating bytes_per_bitmap

2016-06-01 Thread Feifei Xu
On ppc64, bytes_per_bitmap will be (65536*8*65536). Hence append UL to fix integer overflow. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 12 ++-- fs/btrfs/test

[PATCH V2 1/8] Btrfs: test_check_exists: Fix infinite loop when searching for free space entries

2016-06-01 Thread Feifei Xu
s patch fixes the issue by checking the "tmp" variable which point to the most recently searched free space node. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 4 ++-- 1 file ch

[PATCH V2 0/8] Btrfs: self-tests: Support non-4k page size

2016-06-01 Thread Feifei Xu
at separate all change that are not related to hardcoded 4096/sectorsize/PAGE_SIZE. 3) fix some coding style issue - Feifei Xu (8): Btrfs: test_check_exists: Fix infinite loop when searching for free space entries Btrfs: Fix integer overflow when calculating bytes_per_bitmap Btrfs: self-test

Re: [PATCH 3/5] Btrfs: self-tests: Support non-4k page size

2016-05-30 Thread Feifei Xu
On 2016/5/30 21:55, David Sterba wrote: On Sun, May 29, 2016 at 01:17:34PM +0800, Fei Fei Xu wrote: There are more instances of the pointed style issues, please fix all of them. As the changes do not affect functionality I'll add the paches to for-next, but I'm expecting a v2. Thanks, I will

Re: [PATCH 1/5] Btrfs: test_check_exists: Fix infinite loop when searching for free space entries

2016-05-29 Thread Feifei Xu
On 2016/5/27 23:43, Josef Bacik wrote: fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 5e6062c..05c9ef8 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -3662,6

[PATCH 1/5] Btrfs: test_check_exists: Fix infinite loop when searching for free space entries

2016-05-27 Thread Feifei Xu
pdating "info" variable to point to the most recently searched free space node. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH 0/5] Btrfs: enable self-test on ppc64

2016-05-27 Thread Feifei Xu
and nodesizes (e.g. for future subpage-blocksize support). This patchset also fixes the following bugs: 1) Fix integer overflow when calculating bytes_per_bitmap 2) Fix infinite loop when searching for free space 3) Fix extent buffer bitmap test fail on big-endian system Feifei Xu (5): Btrfs

[PATCH 4/5] Btrfs: test_bitmaps: Fix failure on 64k sectorsize

2016-05-27 Thread Feifei Xu
With 64K sectorsize, 1G sized block group cannot span across bitmaps. To execute test_bitmaps() function, this commit allocates "BITS_PER_BITMAP * sectorsize + PAGE_SIZE" sized block group. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by:

[PATCH 5/5] Btrfs: self-test: fix extent buffer bitmap test fail on BE system

2016-05-27 Thread Feifei Xu
while test_bit() reads in unsigned long granularity. Hence we end up comparing wrong bits on big-endian systems such as ppc64. This commit fixes the issue by reading the bitmap in byte granularity. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu

[PATCH 3/5] Btrfs: self-tests: Support non-4k page size

2016-05-27 Thread Feifei Xu
and nodesizes. Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> Signed-off-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> --- fs/btrfs/ctree.c | 6 +- fs/btrfs/disk-io.c | 9 +- fs/btrfs/disk-io.h | 3 +- fs/btrfs

[PATCH 2/5] Btrfs: Fix integer overflow when calculating bytes_per_bitmap

2016-05-27 Thread Feifei Xu
On ppc64, bytes_per_bitmap will be (65536*8*65536). Hence append UL to fix integer overflow. Reviewed-by: Chandan Rajendra <chan...@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- fs/btrfs/free-space-cache.c | 13 +++-- fs/btrfs/test

[PATCH V2] btrfs-progs: Replace hardcoded PAGE_CACHE_SIZE with sectorsize.

2016-03-10 Thread Feifei Xu
PAGE_CACHE_SIZE is hardcoded to 4K in cmds-restore.c. Correct value should be sector size. Fix this through replacing hardcoded 4K to sectorsize. Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- cmds-restore.c | 29 ++--- 1 file changed, 14 insertions(

[PATCH] btrfs-progs: Replace hardcoded PAGE_CACHE_SIZE with getpagesize().

2016-03-09 Thread Feifei Xu
PAGE_CACHE_SIZE is hardcoded to 4K in cmds-restore.c. It makes lzo decompress fail on ppc64. Fix this through replacing hardcoded 4K with getpagesize(). Signed-off-by: Feifei Xu <xufei...@linux.vnet.ibm.com> --- cmds-restore.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-)