* [PATCH] btrfs-progs: tests: add convert test case for block number overflow
@ 2024-06-06 10:32 Srivathsa Dara
2024-06-06 22:32 ` Qu Wenruo
0 siblings, 1 reply; 3+ messages in thread
From: Srivathsa Dara @ 2024-06-06 10:32 UTC (permalink / raw)
To: linux-btrfs; +Cc: rajesh.sivaramasubramaniom, junxiao.bi, clm, josef, dsterba
This test cases will test whether btrfs-convert can handle ext4
filesystems that are largerthan 16TiB.
At 16TiB block numbers overflow 32 bits, btrfs-convert either fails or
corrupts fs if 64 bit block numbers are not supported.
Signed-off-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
---
.../025-64-bit-block-numbers/test.sh | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100755 tests/convert-tests/025-64-bit-block-numbers/test.sh
diff --git a/tests/convert-tests/025-64-bit-block-numbers/test.sh b/tests/convert-tests/025-64-bit-block-numbers/test.sh
new file mode 100755
index 00000000..0eb6bb49
--- /dev/null
+++ b/tests/convert-tests/025-64-bit-block-numbers/test.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Check if btrfs-convert can handle 64 bit block numbers in an ext4 fs.
+# At 16TiB block numbers overflow 32 bits and screw up total size and used
+# space calculation
+
+
+source "$TEST_TOP/common" || exit
+source "$TEST_TOP/common.convert" || exit
+
+check_prereq btrfs-convert
+check_global_prereq mke2fs
+
+setup_root_helper
+prepare_test_dev 16t
+
+convert_test_prep_fs ext4 mke2fs -t ext4 -b 4096
+run_check_umount_test_dev
+
+convert_test_do_convert
+run_check_mount_test_dev
+run_check_umount_test_dev
--
2.39.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: tests: add convert test case for block number overflow
2024-06-06 10:32 [PATCH] btrfs-progs: tests: add convert test case for block number overflow Srivathsa Dara
@ 2024-06-06 22:32 ` Qu Wenruo
2024-06-11 6:04 ` [External] : " Srivathsa Dara
0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2024-06-06 22:32 UTC (permalink / raw)
To: Srivathsa Dara, linux-btrfs
Cc: rajesh.sivaramasubramaniom, junxiao.bi, clm, josef, dsterba
在 2024/6/6 20:02, Srivathsa Dara 写道:
> This test cases will test whether btrfs-convert can handle ext4
> filesystems that are largerthan 16TiB.
>
> At 16TiB block numbers overflow 32 bits, btrfs-convert either fails or
> corrupts fs if 64 bit block numbers are not supported.
You may want to merge this one into the existing overflow tests, check
convert-tests/018-fs-size-overflow, which is doing the 64g overflow test
already.
Otherwise it looks good.
Thanks,
Qu
>
> Signed-off-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
> ---
> .../025-64-bit-block-numbers/test.sh | 21 +++++++++++++++++++
> 1 file changed, 21 insertions(+)
> create mode 100755 tests/convert-tests/025-64-bit-block-numbers/test.sh
>
> diff --git a/tests/convert-tests/025-64-bit-block-numbers/test.sh b/tests/convert-tests/025-64-bit-block-numbers/test.sh
> new file mode 100755
> index 00000000..0eb6bb49
> --- /dev/null
> +++ b/tests/convert-tests/025-64-bit-block-numbers/test.sh
> @@ -0,0 +1,21 @@
> +#!/bin/bash
> +# Check if btrfs-convert can handle 64 bit block numbers in an ext4 fs.
> +# At 16TiB block numbers overflow 32 bits and screw up total size and used
> +# space calculation
> +
> +
> +source "$TEST_TOP/common" || exit
> +source "$TEST_TOP/common.convert" || exit
> +
> +check_prereq btrfs-convert
> +check_global_prereq mke2fs
> +
> +setup_root_helper
> +prepare_test_dev 16t
> +
> +convert_test_prep_fs ext4 mke2fs -t ext4 -b 4096
> +run_check_umount_test_dev
> +
> +convert_test_do_convert
> +run_check_mount_test_dev
> +run_check_umount_test_dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [External] : Re: [PATCH] btrfs-progs: tests: add convert test case for block number overflow
2024-06-06 22:32 ` Qu Wenruo
@ 2024-06-11 6:04 ` Srivathsa Dara
0 siblings, 0 replies; 3+ messages in thread
From: Srivathsa Dara @ 2024-06-11 6:04 UTC (permalink / raw)
To: Qu Wenruo, linux-btrfs@vger.kernel.org
Cc: Rajesh Sivaramasubramaniom, Junxiao Bi, clm@fb.com,
josef@toxicpanda.com, dsterba@suse.com
> 在 2024/6/6 20:02, Srivathsa Dara 写道:
> > This test cases will test whether btrfs-convert can handle ext4
> > filesystems that are largerthan 16TiB.
> >
> > At 16TiB block numbers overflow 32 bits, btrfs-convert either fails or
> > corrupts fs if 64 bit block numbers are not supported.
>
> You may want to merge this one into the existing overflow tests, check convert-tests/018-fs-size-overflow, which is doing the 64g overflow test already.
Sure, I will send a V2.
>
> Otherwise it looks good.
>
> Thanks,
> Qu
> >
> > Signed-off-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
> > ---
> > .../025-64-bit-block-numbers/test.sh | 21 +++++++++++++++++++
> > 1 file changed, 21 insertions(+)
> > create mode 100755
> > tests/convert-tests/025-64-bit-block-numbers/test.sh
> >
> > diff --git a/tests/convert-tests/025-64-bit-block-numbers/test.sh
> > b/tests/convert-tests/025-64-bit-block-numbers/test.sh
> > new file mode 100755
> > index 00000000..0eb6bb49
> > --- /dev/null
> > +++ b/tests/convert-tests/025-64-bit-block-numbers/test.sh
> > @@ -0,0 +1,21 @@
> > +#!/bin/bash
> > +# Check if btrfs-convert can handle 64 bit block numbers in an ext4 fs.
> > +# At 16TiB block numbers overflow 32 bits and screw up total size and
> > +used # space calculation
> > +
> > +
> > +source "$TEST_TOP/common" || exit
> > +source "$TEST_TOP/common.convert" || exit
> > +
> > +check_prereq btrfs-convert
> > +check_global_prereq mke2fs
> > +
> > +setup_root_helper
> > +prepare_test_dev 16t
> > +
> > +convert_test_prep_fs ext4 mke2fs -t ext4 -b 4096
> > +run_check_umount_test_dev
> > +
> > +convert_test_do_convert
> > +run_check_mount_test_dev
> > +run_check_umount_test_dev
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-11 6:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 10:32 [PATCH] btrfs-progs: tests: add convert test case for block number overflow Srivathsa Dara
2024-06-06 22:32 ` Qu Wenruo
2024-06-11 6:04 ` [External] : " Srivathsa Dara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox