* [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev()
@ 2024-12-26 13:36 Chao Yu
2024-12-26 13:36 ` [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device Chao Yu
2024-12-28 4:29 ` [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Zorro Lang
0 siblings, 2 replies; 4+ messages in thread
From: Chao Yu @ 2024-12-26 13:36 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Chao Yu
Then, f2fs/* testcases can use this wrapped common helper instead of
raw codes.
Suggested-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v4:
- no updates
common/rc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/rc b/common/rc
index 7b5bc0b4..ecac2de8 100644
--- a/common/rc
+++ b/common/rc
@@ -833,6 +833,9 @@ _try_mkfs_dev()
ext2|ext3|ext4)
$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $*
;;
+ f2fs)
+ $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
+ ;;
xfs)
$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
;;
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device
2024-12-26 13:36 [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Chao Yu
@ 2024-12-26 13:36 ` Chao Yu
2024-12-28 4:27 ` Zorro Lang
2024-12-28 4:29 ` [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Zorro Lang
1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2024-12-26 13:36 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Chao Yu
This patch introduce a regression testcase to check whether
f2fs can handle discard correctly once underlying lvm device
changes to not support discard after user creates snapshot
on it.
Related bug was fixed by commit bc8aeb04fd80 ("f2fs: fix to
drop all discards after creating snapshot on lvm device")
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v4:
- use "lvcreate -y" to force wiping stale data in device.
tests/f2fs/008 | 57 ++++++++++++++++++++++++++++++++++++++++++++++
tests/f2fs/008.out | 2 ++
2 files changed, 59 insertions(+)
create mode 100755 tests/f2fs/008
create mode 100644 tests/f2fs/008.out
diff --git a/tests/f2fs/008 b/tests/f2fs/008
new file mode 100755
index 00000000..47696f2b
--- /dev/null
+++ b/tests/f2fs/008
@@ -0,0 +1,57 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2024 Oppo. All Rights Reserved.
+#
+# FS QA Test No. f2fs/008
+#
+# This is a regression test to check whether f2fs can handle
+# discard correctly once underlying lvm device changes to not
+# support discard after user creates snapshot on it.
+#
+
+. ./common/preamble
+_begin_fstest auto quick rw
+
+_fixed_by_kernel_commit bc8aeb04fd80 \
+ "f2fs: fix to drop all discards after creating snapshot on lvm device"
+
+_require_scratch_nolvm
+_require_block_device $SCRATCH_DEV
+_require_command "$LVM_PROG" lvm
+
+lvname=lv_$seq
+vgname=vg_$seq
+testfile=$SCRATCH_MNT/testfile
+
+_cleanup()
+{
+ _unmount $SCRATCH_MNT >>$seqres.full 2>&1
+ $LVM_PROG lvremove -ff /dev/mapper/$lvname-snapshot $vgname >>$seqres.full 2>&1
+ $LVM_PROG lvremove -ff /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
+ $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1
+ $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1
+ _udev_wait --removed /dev/mapper/$vgname-$lvname
+ cd /
+ rm -f $tmp.*
+}
+
+$LVM_PROG pvcreate -f $SCRATCH_DEV >>$seqres.full 2>&1
+$LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1
+$LVM_PROG lvcreate -y -L 1024m -n $lvname $vgname >>$seqres.full 2>&1
+_udev_wait /dev/mapper/$vgname-$lvname
+
+_mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
+_mount -o discard /dev/mapper/$vgname-$lvname $SCRATCH_MNT >>$seqres.full 2>&1
+
+dd if=/dev/zero of=$testfile bs=1M count=20 >>$seqres.full 2>&1
+sync
+rm -f $testfile
+sync
+
+# create a snapshot on lvm device
+$LVM_PROG lvcreate -L 1024m -s -n $lvname-snapshot /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
+
+echo "Silence is golden"
+
+status=0
+exit
diff --git a/tests/f2fs/008.out b/tests/f2fs/008.out
new file mode 100644
index 00000000..dd68d5a4
--- /dev/null
+++ b/tests/f2fs/008.out
@@ -0,0 +1,2 @@
+QA output created by 008
+Silence is golden
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device
2024-12-26 13:36 ` [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device Chao Yu
@ 2024-12-28 4:27 ` Zorro Lang
0 siblings, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2024-12-28 4:27 UTC (permalink / raw)
To: Chao Yu; +Cc: Zorro Lang, fstests, jaegeuk, linux-f2fs-devel
On Thu, Dec 26, 2024 at 09:36:31PM +0800, Chao Yu wrote:
> This patch introduce a regression testcase to check whether
> f2fs can handle discard correctly once underlying lvm device
> changes to not support discard after user creates snapshot
> on it.
>
> Related bug was fixed by commit bc8aeb04fd80 ("f2fs: fix to
> drop all discards after creating snapshot on lvm device")
>
> Cc: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v4:
> - use "lvcreate -y" to force wiping stale data in device.
> tests/f2fs/008 | 57 ++++++++++++++++++++++++++++++++++++++++++++++
> tests/f2fs/008.out | 2 ++
> 2 files changed, 59 insertions(+)
> create mode 100755 tests/f2fs/008
> create mode 100644 tests/f2fs/008.out
>
> diff --git a/tests/f2fs/008 b/tests/f2fs/008
> new file mode 100755
> index 00000000..47696f2b
> --- /dev/null
> +++ b/tests/f2fs/008
> @@ -0,0 +1,57 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2024 Oppo. All Rights Reserved.
> +#
> +# FS QA Test No. f2fs/008
> +#
> +# This is a regression test to check whether f2fs can handle
> +# discard correctly once underlying lvm device changes to not
> +# support discard after user creates snapshot on it.
> +#
> +
> +. ./common/preamble
> +_begin_fstest auto quick rw
> +
> +_fixed_by_kernel_commit bc8aeb04fd80 \
> + "f2fs: fix to drop all discards after creating snapshot on lvm device"
> +
> +_require_scratch_nolvm
> +_require_block_device $SCRATCH_DEV
> +_require_command "$LVM_PROG" lvm
> +
> +lvname=lv_$seq
> +vgname=vg_$seq
> +testfile=$SCRATCH_MNT/testfile
> +
> +_cleanup()
> +{
> + _unmount $SCRATCH_MNT >>$seqres.full 2>&1
> + $LVM_PROG lvremove -ff /dev/mapper/$lvname-snapshot $vgname >>$seqres.full 2>&1
> + $LVM_PROG lvremove -ff /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
> + $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1
> + $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1
> + _udev_wait --removed /dev/mapper/$vgname-$lvname
> + cd /
> + rm -f $tmp.*
> +}
> +
> +$LVM_PROG pvcreate -f $SCRATCH_DEV >>$seqres.full 2>&1
> +$LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1
> +$LVM_PROG lvcreate -y -L 1024m -n $lvname $vgname >>$seqres.full 2>&1
OK, so you choose "-y" option. I think it's fine, due to this option was
brought in by below commit [1] 11 years ago. It's nearly same old with f2fs :)
So,
Reviewed-by: Zorro Lang <zlang@redhat.com>
[1]
commit b6dab4e0598df7b6a44a32749fdb846c03aa692d
Author: Peter Rajnoha <prajnoha@redhat.com>
Date: Wed Nov 6 16:16:34 2013 +0100
lv_manip: rename set_lv -> wipe_lv and include signature wiping capability
> +_udev_wait /dev/mapper/$vgname-$lvname
> +
> +_mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
> +_mount -o discard /dev/mapper/$vgname-$lvname $SCRATCH_MNT >>$seqres.full 2>&1
> +
> +dd if=/dev/zero of=$testfile bs=1M count=20 >>$seqres.full 2>&1
> +sync
> +rm -f $testfile
> +sync
> +
> +# create a snapshot on lvm device
> +$LVM_PROG lvcreate -L 1024m -s -n $lvname-snapshot /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1
> +
> +echo "Silence is golden"
> +
> +status=0
> +exit
> diff --git a/tests/f2fs/008.out b/tests/f2fs/008.out
> new file mode 100644
> index 00000000..dd68d5a4
> --- /dev/null
> +++ b/tests/f2fs/008.out
> @@ -0,0 +1,2 @@
> +QA output created by 008
> +Silence is golden
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev()
2024-12-26 13:36 [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Chao Yu
2024-12-26 13:36 ` [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device Chao Yu
@ 2024-12-28 4:29 ` Zorro Lang
1 sibling, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2024-12-28 4:29 UTC (permalink / raw)
To: Chao Yu; +Cc: Zorro Lang, fstests, jaegeuk, linux-f2fs-devel
On Thu, Dec 26, 2024 at 09:36:30PM +0800, Chao Yu wrote:
> Then, f2fs/* testcases can use this wrapped common helper instead of
> raw codes.
>
> Suggested-by: Zorro Lang <zlang@kernel.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v4:
> - no updates
> common/rc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 7b5bc0b4..ecac2de8 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -833,6 +833,9 @@ _try_mkfs_dev()
> ext2|ext3|ext4)
> $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $*
> ;;
> + f2fs)
> + $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
> + ;;
Oh, that's fine to me if you don't want to use mkfs.f2fs directly.
Reviewed-by: Zorro Lang <zlang@redhat.com>
> xfs)
> $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
> ;;
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-28 4:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 13:36 [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Chao Yu
2024-12-26 13:36 ` [PATCH v4 2/2] f2fs/008: test snapshot creation/deletion on lvm device Chao Yu
2024-12-28 4:27 ` Zorro Lang
2024-12-28 4:29 ` [PATCH v4 1/2] common/rc: support f2fs in _mkfs_dev() Zorro Lang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox