common/rc: f2fs do not support metadata journaling
PATCH 1/1 common/rc: f2fs do not support metadata journaling
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS -- /dev/sdb
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sdb /tmp/scratch
generic/050 4s ... - output mismatch (see /root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++ /root/work/xfstests-dev/results//generic/050.out.bad 2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount: SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u /root/work/xfstests-dev/tests/generic/050.out /root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests
###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS -- /dev/sdb
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sdb /tmp/scratch
generic/050 4s ... 4s
Ran: generic/050
Passed all 1 tests
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
@@ -3543,7 +3543,7 @@ _has_metadata_journaling() fi case "$FSTYP" in - ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs) echo "$FSTYP does not support metadata journaling" return 1 ;;
Signature · 1 line
2.13.6
PATCH 1/1 generic/103: leave more space for f2fs
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...
Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT
+ echo "avail = ${avail}"
filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}"
$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
+ df
}
f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 553292 12027572 5% /mnt/scratch +avail = 12316233728 +filesizekb = 12027060 +fallocate: No space left on device +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 12580864 0 100% /mnt/scratch Silence is golden.
xfs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 120828 12451844 1% /mnt/scratch +avail = 12750688256 +filesizekb = 12451332 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 12572160 512 100% /mnt/scratch Silence is golden.
f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 41048 11633304 1% /mnt/scratch +avail = 11912503296 +filesizekb = 11632792 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 11673844 508 100% /mnt/scratch Silence is golden.
after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb 12580864 12580396 468 100% /tmp/scratch
Silence is golden.
tests/generic/103 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
tests/generic/103 +9 -1
@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() { file=$1 + leave=512 + + # Try to leave ~512KB, but during the fallocate, f2fs will be filled. + # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs. + if [ $FSTYP == "f2fs" ]; then + leave=12288 + fi # consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT` - filesizekb=$((avail / 1024 - 512)) + filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }
Signature · 1 line
2.25.4
Re: [PATCH] generic/103: leave more space for f2fs
Quoted 10 lines · Sun Ke
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
And this also could be a bug in f2fs, that couldn't fallocate enough space when free space is larger than request size.
I think the whole patchset needs review from f2fs folks.
Thanks,
Eryu
Quoted 86 lines
Signed-off-by Sun Ke <[email protected]>---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT
+ echo "avail = ${avail}"
filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}"
$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
+ df
}f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 553292 12027572 5% /mnt/scratch +avail = 12316233728 +filesizekb = 12027060 +fallocate: No space left on device +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 12580864 0 100% /mnt/scratch Silence is golden.xfs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 120828 12451844 1% /mnt/scratch +avail = 12750688256 +filesizekb = 12451332 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 12572160 512 100% /mnt/scratch Silence is golden.f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 41048 11633304 1% /mnt/scratch +avail = 11912503296 +filesizekb = 11632792 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 11673844 508 100% /mnt/scratch Silence is golden.after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb12580864 12580396 468 100%/tmp/scratch
Silence is golden.tests/generic/103 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)tests/generic/103 +9
-1@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() { file=$1 + leave=512 + + # Try to leave ~512KB, but during the fallocate, f2fs will be filled. + # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs. + if [ $FSTYP == "f2fs" ]; then + leave=12288 + fi # consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT` - filesizekb=$((avail / 1024 - 512)) + filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }Signature · 1 line
2.25.4
Re: [PATCH] generic/103: leave more space for f2fs
Quoted 12 lines · Eryu Guan
Quoted 10 lines · Sun Ke
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
Quoted 7 lines
And this also could be a bug in f2fs, that couldn't fallocate enough space when free space is larger than request size.
I think the whole patchset needs review from f2fs folks.
Thanks,
Eryu
I have cc [email protected].
Thanks,
Sun Ke
Quoted 89 lines
Quoted 87 lines
Signed-off-by Sun Ke <[email protected]>---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT
+ echo "avail = ${avail}"
filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}"
$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
+ df
}f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 553292 12027572 5% /mnt/scratch +avail = 12316233728 +filesizekb = 12027060 +fallocate: No space left on device +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 12580864 0 100% /mnt/scratch Silence is golden.xfs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 120828 12451844 1% /mnt/scratch +avail = 12750688256 +filesizekb = 12451332 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 12572160 512 100% /mnt/scratch Silence is golden.f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 41048 11633304 1% /mnt/scratch +avail = 11912503296 +filesizekb = 11632792 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 11673844 508 100% /mnt/scratch Silence is golden.after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb12580864 12580396 468 100%/tmp/scratch
Silence is golden.tests/generic/103 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)tests/generic/103 +9
-1@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() { file=$1 + leave=512 + + # Try to leave ~512KB, but during the fallocate, f2fs will be filled. + # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs. + if [ $FSTYP == "f2fs" ]; then + leave=12288 + fi # consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT` - filesizekb=$((avail / 1024 - 512)) + filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }Signature · 1 line
2.25.4.
Re: [PATCH] generic/103: leave more space for f2fs
In reply to Sun KeQuoted 95 lines · Sun Ke
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
Signed-off-by Sun Ke <[email protected]>---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT
+ echo "avail = ${avail}"
filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}"
$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
+ df
}f2fs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 553292 12027572 5% /mnt/scratch +avail = 12316233728 +filesizekb = 12027060 +fallocate: No space left on device +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12580864 12580864 0 100% /mnt/scratch Silence is golden.xfs:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 120828 12451844 1% /mnt/scratch +avail = 12750688256 +filesizekb = 12451332 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12572672 12572160 512 100% /mnt/scratch Silence is golden.ext4:
QA output created by 103 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 41048 11633304 1% /mnt/scratch +avail = 11912503296 +filesizekb = 11632792 +Filesystem 1K-blocks Used Available Use% Mounted on ... +/dev/sdb 12319880 11673844 508 100% /mnt/scratch Silence is golden.after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb12580864 12580396 468 100%/tmp/scratch
Silence is golden.tests/generic/103 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)tests/generic/103 +9
-1@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() { file=$1 + leave=512 + + # Try to leave ~512KB, but during the fallocate, f2fs will be filled. + # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs. + if [ $FSTYP == "f2fs" ]; then + leave=12288 + fi # consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT` - filesizekb=$((avail / 1024 - 512)) + filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }
Re: [f2fs-dev] [PATCH] generic/103: leave more space for f2fs
Quoted 83 lines · Sun Ke
Quoted 80 lines · Sun Ke
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
Signed-off-by Sun Ke <[email protected]>---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT+ echo "avail = ${avail}" filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}" $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file + df
}f2fs:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12580864 553292 12027572 5%/mnt/scratch+avail = 12316233728
+filesizekb = 12027060
+fallocate: No space left on device
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12580864 12580864 0 100%/mnt/scratchSilence is golden.xfs:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12572672 120828 12451844 1%/mnt/scratch+avail = 12750688256
+filesizekb = 12451332
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12572672 12572160 512 100%/mnt/scratchSilence is golden.ext4:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12319880 41048 11633304 1%/mnt/scratch+avail = 11912503296
+filesizekb = 11632792
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12319880 11673844 508 100%/mnt/scratchSilence is golden.after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb 12580864 12580396 468 100%/tmp/scratchSilence is golden.tests/generic/103 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)tests/generic/103 +0
-0@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() {file=$1
+ leave=512
+
Quoted 8 lines
Quoted 8 lines
+ # Try to leave ~512KB, but during the fallocate, f2fs will be filled. + # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs.
+ if [ $FSTYP == "f2fs" ]; then
+ leave=12288
+ fi# consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT`
if [ $FSTYP == "f2fs" ]; then
left=$((left + avail / 1024000))
fif2fs uses index(radix) tree as mapping metadata, its space overhead is about one thousandth of the data, so can you please try above calculation?
Thanks,
Quoted 11 lines
Quoted 5 lines
- filesizekb=$((avail / 1024 - 512))
+ filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH] generic/103: leave more space for f2fs
Quoted 98 lines · Chao Yu
Quoted 84 lines · Sun Ke
Quoted 81 lines · Sun Ke
It failed on f2fs:
QA output created by 103
+fallocate: No space left on device
Silence is golden.
...Try to leave ~512KB, but during the fallocate, f2fs will be filled. Provide error prompt: "fallocate: No space left on device".
Leave more space for f2fs.
Signed-off-by Sun Ke <[email protected]>---
I add some test code
+ df
avail=_get_available_space $SCRATCH_MNT+ echo "avail = ${avail}" filesizekb=$((avail / 1024 - 512))
+ echo "filesizekb = ${filesizekb}" $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file + df
}f2fs:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12580864 553292 12027572 5%/mnt/scratch+avail = 12316233728
+filesizekb = 12027060
+fallocate: No space left on device
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12580864 12580864 0 100%/mnt/scratchSilence is golden.xfs:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12572672 120828 12451844 1%/mnt/scratch+avail = 12750688256
+filesizekb = 12451332
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12572672 12572160 512 100%/mnt/scratchSilence is golden.ext4:
QA output created by 103
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12319880 41048 11633304 1%/mnt/scratch+avail = 11912503296
+filesizekb = 11632792
+Filesystem 1K-blocks Used Available Use% Mounted on
...
+/dev/sdb 12319880 11673844 508 100%/mnt/scratchSilence is golden.after change (f2fs)
QA output created by 103
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb 12580864 12580396 468 100%/tmp/scratchSilence is golden.tests/generic/103 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)tests/generic/103 +0
-0@@ -40,10 +40,18 @@ rm -f $seqres.full _consume_freesp() {file=$1
+ leave=512
+
+ # Try to leave ~512KB, but during the fallocate, f2fs will beQuoted 8 lines
Quoted 8 lines
filled.
+ # Provide error prompt: "fallocate: No space left on device". Leave + # more space for f2fs.
+ if [ $FSTYP == "f2fs" ]; then
+ leave=12288
+ fi# consume nearly all available space (leave ~512kB) avail=`_get_available_space $SCRATCH_MNT`if [ $FSTYP == "f2fs" ]; then
left=$((left + avail / 1024000))
fi
Quoted 5 lines
f2fs uses index(radix) tree as mapping metadata, its space overhead is about one thousandth of the data, so can you please try above calculation?
Thanks,
I have tried your calculation, it works. I will send v2 patch.
Thanks,
Sun Ke
Quoted 13 lines
Quoted 8 lines
Quoted 6 lines
- filesizekb=$((avail / 1024 - 512))
+ filesizekb=$((avail / 1024 - $leave)) $XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file }Quoted 4 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
PATCH 1/1 generic/260: f2fs is also special
In reply to Sun KeIt seem that f2fs also special like btrfs.
[+] Default length with start set (should succeed)
[+] Length beyond the end of fs (should succeed)
[+] Length beyond the end of fs with start set (should succeed)
+After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long. +It seems that fs logic handling len argument overflows
---
I am not sure about that. o(╯□╰)o
tests/generic/260 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/260 +2 -2
@@ -100,7 +100,7 @@ fi # It is because btrfs does not have not-yet-used parts of the device # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then status=1 echo "After the full fs discard $bytes bytes were discarded"\ "however the file system is $(_math "$fssize*1024") bytes long."
@@ -160,7 +160,7 @@ _scratch_mount # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim) -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then status=1 echo "It seems that fs logic handling len argument overflows" fi
Signature · 1 line
2.13.6
Re: [PATCH] generic/260: f2fs is also special
Quoted 38 lines · Sun Ke
It seem that f2fs also special like btrfs.
[+] Default length with start set (should succeed) [+] Length beyond the end of fs (should succeed)
[+] Length beyond the end of fs with start set (should succeed)(quoted diff) +2
-0+After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long. +It seems that fs logic handling len argument overflowsSigned-off-by Sun Ke <[email protected]>---
I am not sure about that. o(╯□╰)otests/generic/260 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tests/generic/260 +2
-2@@ -100,7 +100,7 @@ fi # It is because btrfs does not have not-yet-used parts of the device # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then status=1 echo "After the full fs discard $bytes bytes were discarded"\ "however the file system is $(_math "$fssize*1024") bytes long."@@ -160,7 +160,7 @@ _scratch_mount # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim) -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then status=1 echo "It seems that fs logic handling len argument overflows" fi
Re: [f2fs-dev] [PATCH] generic/260: f2fs is also special
Quoted 10 lines · Sun Ke
Review
Quoted 7 lines · Sun Ke
It seem that f2fs also special like btrfs.
[+] Default length with start set (should succeed) [+] Length beyond the end of fs (should succeed)
[+] Length beyond the end of fs with start set (should succeed)(quoted diff) +2
-0+After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long. +It seems that fs logic handling len argument overflows
Well, the root cause is f2fs can tag a special flag TRIMMED_FLAG to indicate the whole filesystem is trimmed, so after mkfs/fstrim(), following fstrim() won't trim any block.
Can you please update commit message and add comments in script?
Thanks,
Quoted 37 lines
Quoted 27 lines
Signed-off-by Sun Ke <[email protected]>---
I am not sure about that. o(╯□╰)otests/generic/260 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)tests/generic/260 +1
-1@@ -100,7 +100,7 @@ fi # It is because btrfs does not have not-yet-used parts of the device # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; thenstatus=1
echo "After the full fs discard $bytes bytes were discarded"\
"however the file system is $(_math "$fssize*1024") bytes long."tests/generic/260 +1
-1@@ -160,7 +160,7 @@ _scratch_mount # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim) -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; thenQuoted 4 lines
status=1
echo "It seems that fs logic handling len argument overflows" fi_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH] generic/260: f2fs is also special
Quoted 17 lines · Chao Yu
Quoted 11 lines · Sun Ke
Quoted 8 lines · Sun Ke
It seem that f2fs also special like btrfs.
[+] Default length with start set (should succeed) [+] Length beyond the end of fs (should succeed)
[+] Length beyond the end of fs with start set (should succeed) +After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long.
+It seems that fs logic handling len argument overflowsWell, the root cause is f2fs can tag a special flag
TRIMMED_FLAGto indicate the whole filesystem is trimmed, so after mkfs/fstrim(), followingfstrim()won't trim any block.
Quoted 3 lines
Can you please update commit message and add comments in script?
Thanks,
Glad to do that.
Thanks,
Sun Ke
Quoted 41 lines
Quoted 32 lines
Quoted 32 lines
Signed-off-by Sun Ke <[email protected]>---
I am not sure about that. o(╯□╰)otests/generic/260 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)tests/generic/260 +1
-1@@ -100,7 +100,7 @@ fi # It is because btrfs does not have not-yet-used parts of the device # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] &&[ $FSTYP != "f2fs" ]; then
status=1
echo "After the full fs discard $bytes bytes were discarded"\
"however the file system is $(_math "$fssize*1024") bytes long."tests/generic/260 +1
-1@@ -160,7 +160,7 @@ _scratch_mount # mapped and since we got here right after the mkfs, there is not # enough free extents in the root tree. bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim) -if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then +if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] &&[ $FSTYP != "f2fs" ]; then
status=1
echo "It seems that fs logic handling len argument overflows"Quoted 8 lines
Quoted 2 lines
fi
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
Quoted 70 lines · Sun Ke
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
Signed-off-by Sun Ke <[email protected]>---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050FSTYP -- f2fs PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS -- /dev/sdb
MOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++/root/work/xfstests-dev/results//generic/050.out.bad2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050FSTYP -- f2fs PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS -- /dev/sdb
MOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... 4s
Ran: generic/050
Passed all 1 testscommon/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +1
-1@@ -3543,7 +3543,7 @@ _has_metadata_journaling() fi case "$FSTYP" in - ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs) echo "$FSTYP does not support metadata journaling" return 1 ;;
Quoted 9 lines · Sun Ke
Quoted 6 lines · Sun Ke
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
It looks not correct.
FYI,
https://lkml.org/lkml/2021/3/23/75
Thanks,
Quoted 69 lines
Quoted 57 lines
Signed-off-by Sun Ke <[email protected]>---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++ /root/work/xfstests-dev/results//generic/050.out.bad 2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... 4s
Ran: generic/050
Passed all 1 testscommon/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0@@ -3543,7 +3543,7 @@ _has_metadata_journaling()fi
case "$FSTYP" inQuoted 6 lines
- ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs)echo "$FSTYP does not support metadata journaling" return 1
;;_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 11 lines · Chao Yu
Quoted 9 lines · Sun Ke
Quoted 6 lines · Sun Ke
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
Quoted 7 lines
It looks not correct.
FYI,
https://lkml.org/lkml/2021/3/23/75
Thanks,
Your patch should fix this bug, but it still fail in 5.13.0-rc5.
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs PLATFORM -- Linux/x86_64 localhost 5.13.0-rc5 #2 SMP Wed Jun 16 20:36:54 CST 2021 MKFS_OPTIONS -- /dev/sdb
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sdb /tmp/scratch
generic/050 3s ... - output mismatch (see /root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++ /root/work/xfstests-dev/results//generic/050.out.bad 2021-06-17 11:40:26.107000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount: SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u /root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests
Thanks,
Sun Ke
Quoted 71 lines
Quoted 62 lines
Quoted 62 lines
Signed-off-by Sun Ke <[email protected]>---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++/root/work/xfstests-dev/results//generic/050.out.bad2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... 4s
Ran: generic/050
Passed all 1 testscommon/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0@@ -3543,7 +3543,7 @@ _has_metadata_journaling()fi
case "$FSTYP" in- ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs)echo "$FSTYP does not support metadata journaling" return 1
Quoted 8 lines
Quoted 2 lines
;;
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
Quoted 14 lines · Sun Ke
Quoted 11 lines · Chao Yu
Quoted 9 lines · Sun Ke
Quoted 6 lines · Sun Ke
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
Quoted 8 lines
Quoted 7 lines
It looks not correct.
FYI,
https://lkml.org/lkml/2021/3/23/75
Thanks,
Your patch should fix this bug, but it still fail in 5.13.0-rc5.
It's due to that patch was not merged, please check details in that thread.
Thanks,
Quoted 97 lines
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.13.0-rc5 #2 SMP Wed Jun 16 20:36:54 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 3s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++ /root/work/xfstests-dev/results//generic/050.out.bad 2021-06-17 11:40:26.107000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 testsThanks,
Sun KeQuoted 71 lines
Quoted 62 lines
Quoted 62 lines
Signed-off-by Sun Ke <[email protected]>---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++/root/work/xfstests-dev/results//generic/050.out.bad2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... 4s
Ran: generic/050
Passed all 1 testscommon/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0@@ -3543,7 +3543,7 @@ _has_metadata_journaling()fi
case "$FSTYP" in- ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs)echo "$FSTYP does not support metadata journaling" return 1
Quoted 8 lines
Quoted 2 lines
;;
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
Quoted 19 lines · Chao Yu
Quoted 18 lines · Sun Ke
Quoted 15 lines · Chao Yu
Quoted 9 lines · Sun Ke
Quoted 6 lines · Sun Ke
In generic/50, touch 100 files, go down the fs immediately, Then umount and set the disk readi-only. Try to mount it again without \-o norecovery\, it should fail, because it can not recovery on a read-only device. But f2fs mount successfully and the test fail.
f2fs seems do not support metadata journaling.
It looks not correct.
FYI,
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
https://lkml.org/lkml/2021/3/23/75
Thanks,
Your patch should fix this bug, but it still fail in 5.13.0-rc5.
It's due to that patch was not merged, please check details in that thread.
Thanks,
CP_UMOUNT_FLAG decide if it need to recovery. Without your patch, it only print the waring message and both goto reset_checkpoint. I think I have got the root reason.
Thanks,
Sun Ke
Quoted 99 lines
Quoted 25 lines
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.13.0-rc5 #2 SMP Wed Jun 16 20:36:54 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 3s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++/root/work/xfstests-dev/results//generic/050.out.bad2021-06-17 11:40:26.107000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 testsQuoted 73 lines
Thanks,
Sun KeQuoted 71 lines
Quoted 62 lines
Quoted 62 lines
Signed-off-by Sun Ke <[email protected]>---
I am not very sure if f2fs do not support metadata journaling.
###
before change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... - output mismatch (see
/root/work/xfstests-dev/results//generic/050.out.bad)
--- tests/generic/050.out 2021-05-31 15:37:40.000000000 +0800
+++/root/work/xfstests-dev/results//generic/050.out.bad2021-06-11 16:48:19.993000000 +0800
@@ -13,9 +13,7 @@
setting device read-only
mounting filesystem that needs recovery on a read-only device:
mount: device write-protected, mounting read-only
-mount: cannot mount device read-only
unmounting read-only filesystem
-umount:SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
...
(Run 'diff -u/root/work/xfstests-dev/tests/generic/050.out/root/work/xfstests-dev/results//generic/050.out.bad' to see the entire diff)
Ran: generic/050
Failures: generic/050
Failed 1 of 1 tests###
after change
###
[root@localhost xfstests-dev]# ./check tests/generic/050
FSTYP -- f2fs
PLATFORM -- Linux/x86_64 localhost 5.12.0-rc5-next-20210330 #8 SMP Tue Jun 8 11:09:37 CST 2021 MKFS_OPTIONS --/dev/sdbMOUNT_OPTIONS-- -o acl,user_xattr/dev/sdb/tmp/scratchgeneric/050 4s ... 4s
Ran: generic/050
Passed all 1 testscommon/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0@@ -3543,7 +3543,7 @@ _has_metadata_journaling()fi
case "$FSTYP" in- ext2|vfat|msdos|udf|exfat|tmpfs) + ext2|vfat|msdos|udf|exfat|tmpfs|f2fs)echo "$FSTYP does not support metadata journaling" return 1
Quoted 8 lines
Quoted 2 lines
;;
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
.