* [PATCH v2] f2fs/011: use random data to avoid file compression
@ 2025-10-30 5:45 Joanne Chang
2025-10-30 6:50 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Joanne Chang @ 2025-10-30 5:45 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: Jaegeuk Kim, linux-f2fs-devel, Chao Yu, Joanne Chang
Currently, the created files are filled with 0. When filesystem level
compression is used, they take up much less space than expected. So
the final fallocate does not show an error.
The created files are filled by /dev/urandom instead to ensure they
are not compressed. This way the files take up the same space whether
compression is used or not.
Signed-off-by: Joanne Chang <joannechien@google.com>
---
v2:
- changed dd to $XFS_IO_PROG as suggested by Chao Yu
tests/f2fs/011 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/f2fs/011 b/tests/f2fs/011
index c21cb586..07c94d8c 100755
--- a/tests/f2fs/011
+++ b/tests/f2fs/011
@@ -36,7 +36,7 @@ pinfile=$SCRATCH_MNT/file
# simulate fragment status in f2fs
for ((i=0;i<256;i++)) do
- $XFS_IO_PROG -f -c "pwrite 0 1m" $SCRATCH_MNT/$i >>$seqres.full
+ $XFS_IO_PROG -f -c "pwrite -i /dev/urandom 0 1m" $SCRATCH_MNT/$i >>$seqres.full
done
sync
--
2.51.1.930.gacf6e81ea2-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] f2fs/011: use random data to avoid file compression
2025-10-30 5:45 [PATCH v2] f2fs/011: use random data to avoid file compression Joanne Chang
@ 2025-10-30 6:50 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2025-10-30 6:50 UTC (permalink / raw)
To: Joanne Chang, Zorro Lang, fstests; +Cc: chao, Jaegeuk Kim, linux-f2fs-devel
On 10/30/25 13:45, Joanne Chang wrote:
> Currently, the created files are filled with 0. When filesystem level
> compression is used, they take up much less space than expected. So
> the final fallocate does not show an error.
>
> The created files are filled by /dev/urandom instead to ensure they
> are not compressed. This way the files take up the same space whether
> compression is used or not.
>
> Signed-off-by: Joanne Chang <joannechien@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-30 6:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 5:45 [PATCH v2] f2fs/011: use random data to avoid file compression Joanne Chang
2025-10-30 6:50 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox