* [PATCH v2] common/rc: add _require_blocks_in_file helper
@ 2025-12-29 2:31 Joanne Chang
2026-01-04 14:42 ` Chao Yu
2026-01-07 6:08 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Joanne Chang @ 2025-12-29 2:31 UTC (permalink / raw)
To: Zorro Lang, fstests
Cc: Jaegeuk Kim, linux-f2fs-devel, Chao Yu, Christoph Hellwig,
Joanne Chang
generic/735 attempts to create a file with nearly 2^32 blocks. However,
some filesystems have a maximum file block limit below this threshold.
For instance, F2FS is limited to approximately 2^30 blocks due to the
capacity of the inode. So add _require_blocks_in_file helper to skip the
test in such cases.
Signed-off-by: Joanne Chang <joannechien@google.com>
---
v1 -> v2:
- changed title from "generic/735: disable for f2fs"
- used a new helper function instead of _exclude_fs as Christoph Hellwig
suggested
common/rc | 16 ++++++++++++++++
tests/generic/735 | 1 +
2 files changed, 17 insertions(+)
diff --git a/common/rc b/common/rc
index c3cdc220..e92f4854 100644
--- a/common/rc
+++ b/common/rc
@@ -6120,6 +6120,22 @@ _require_file_attr_special()
fi
}
+# Require filesystem to accomodate enough blocks in a file
+_require_blocks_in_file()
+{
+ local blocks=$1
+
+ case $FSTYP in
+ f2fs)
+ if [ $blocks -gt 1057053439 ]; then
+ _notrun "$blocks blocks per file not supported on $FSTYP"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+}
+
################################################################################
# make sure this script returns success
/bin/true
diff --git a/tests/generic/735 b/tests/generic/735
index 9bbdf3a1..2fbf125c 100755
--- a/tests/generic/735
+++ b/tests/generic/735
@@ -22,6 +22,7 @@ fi
_require_odirect
_require_xfs_io_command "falloc"
_require_xfs_io_command "finsert"
+_require_blocks_in_file $(( (1 << 32) - 1 ))
dev_size=$((80 * 1024 * 1024))
_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
--
2.52.0.322.g1dd061c0dc-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] common/rc: add _require_blocks_in_file helper
2025-12-29 2:31 [PATCH v2] common/rc: add _require_blocks_in_file helper Joanne Chang
@ 2026-01-04 14:42 ` Chao Yu
2026-01-07 6:08 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Chao Yu @ 2026-01-04 14:42 UTC (permalink / raw)
To: Joanne Chang, Zorro Lang, fstests
Cc: chao, Jaegeuk Kim, linux-f2fs-devel, Christoph Hellwig
On 12/29/2025 10:31 AM, Joanne Chang wrote:
> generic/735 attempts to create a file with nearly 2^32 blocks. However,
> some filesystems have a maximum file block limit below this threshold.
> For instance, F2FS is limited to approximately 2^30 blocks due to the
> capacity of the inode. So add _require_blocks_in_file helper to skip the
> test in such cases.
>
> Signed-off-by: Joanne Chang <joannechien@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] common/rc: add _require_blocks_in_file helper
2025-12-29 2:31 [PATCH v2] common/rc: add _require_blocks_in_file helper Joanne Chang
2026-01-04 14:42 ` Chao Yu
@ 2026-01-07 6:08 ` Christoph Hellwig
2026-01-07 8:12 ` Joanne Chang
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-01-07 6:08 UTC (permalink / raw)
To: Joanne Chang
Cc: Zorro Lang, fstests, Jaegeuk Kim, linux-f2fs-devel, Chao Yu,
Christoph Hellwig
On Mon, Dec 29, 2025 at 02:31:45AM +0000, Joanne Chang wrote:
> generic/735 attempts to create a file with nearly 2^32 blocks. However,
> some filesystems have a maximum file block limit below this threshold.
> For instance, F2FS is limited to approximately 2^30 blocks due to the
> capacity of the inode. So add _require_blocks_in_file helper to skip the
> test in such cases.
I still don't understand why we can't do this programmatically. I guess
it would be simply too slow? In that case that should probably be
documented here in the commit log. Otherwise this looks good to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] common/rc: add _require_blocks_in_file helper
2026-01-07 6:08 ` Christoph Hellwig
@ 2026-01-07 8:12 ` Joanne Chang
2026-01-07 8:18 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Joanne Chang @ 2026-01-07 8:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Zorro Lang, fstests, Jaegeuk Kim, linux-f2fs-devel, Chao Yu
On Wed, Jan 7, 2026 at 2:08 PM Christoph Hellwig <hch@infradead.org> wrote:
> I still don't understand why we can't do this programmatically. I guess
> it would be simply too slow? In that case that should probably be
> documented here in the commit log. Otherwise this looks good to me.
I used a constant to avoid masking bugs that cause the maximum file size
to shrink on filesystems that should support this test. I can add the
reason to the commit message if that would make it clearer.
Best regards,
Joanne
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] common/rc: add _require_blocks_in_file helper
2026-01-07 8:12 ` Joanne Chang
@ 2026-01-07 8:18 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-01-07 8:18 UTC (permalink / raw)
To: Joanne Chang
Cc: Christoph Hellwig, Zorro Lang, fstests, Jaegeuk Kim,
linux-f2fs-devel, Chao Yu
On Wed, Jan 07, 2026 at 04:12:44PM +0800, Joanne Chang wrote:
> On Wed, Jan 7, 2026 at 2:08 PM Christoph Hellwig <hch@infradead.org> wrote:
> > I still don't understand why we can't do this programmatically. I guess
> > it would be simply too slow? In that case that should probably be
> > documented here in the commit log. Otherwise this looks good to me.
>
> I used a constant to avoid masking bugs that cause the maximum file size
> to shrink on filesystems that should support this test. I can add the
> reason to the commit message if that would make it clearer.
That would be great, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-07 8:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-29 2:31 [PATCH v2] common/rc: add _require_blocks_in_file helper Joanne Chang
2026-01-04 14:42 ` Chao Yu
2026-01-07 6:08 ` Christoph Hellwig
2026-01-07 8:12 ` Joanne Chang
2026-01-07 8:18 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox