Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
@ 2026-08-24  8:56 Wake Liu via ltp
  2026-08-24 10:18 ` Avinesh Kumar via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: Wake Liu via ltp @ 2026-08-24  8:56 UTC (permalink / raw)
  To: ltp; +Cc: Wake Liu

The parallel scenario concurrently spawns multiple workers (default 5),
each creating 2,185 files and directories, totaling 10,925 objects.

On exfat, each file and directory occupies at least one cluster (default
32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.
With filesystem metadata (FAT, allocation bitmap, upcase table),
directory growth, boundary alignment, and multi-worker concurrent
allocation fragmentation, the current 512 MB device size is easily
exhausted, leading to ENOSPC failures during write() or mkdir():

  inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
  inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)

Increase dev_min_size to 1024 MB to provide sufficient headroom for the
parallel scenario on exfat.

Fixes: ecf418722780 ("inode01: increase dev_min_size to fit the peak usage in parallel scenario")
Signed-off-by: Wake Liu <wakel@google.com>
---
 testcases/kernel/fs/inode/inode01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c
index d41ff2c62..87ee07612 100644
--- a/testcases/kernel/fs/inode/inode01.c
+++ b/testcases/kernel/fs/inode/inode01.c
@@ -68,7 +68,7 @@ static void create_tree(const struct tcase *tc, const char *parent,
 }
 
 static void record_inode(struct inode_info *inodes, unsigned int idx,
-			 const char *path, ino_t ino)
+			 const char *path, uint64_t ino)
 {
 	inodes[idx].ino = ino;
 	snprintf(inodes[idx].path, sizeof(inodes[idx].path), "%s", path);
@@ -256,7 +256,7 @@ static struct tst_test test = {
 	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_root = 1,
-	.dev_min_size = 512,
+	.dev_min_size = 1024,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
 	.timeout = 300,
-- 
2.55.0.766.g2966f0265a-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
  2026-08-24  8:56 Wake Liu via ltp
@ 2026-08-24 10:18 ` Avinesh Kumar via ltp
  2026-08-25  7:38   ` Wake Liu via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-08-24 10:18 UTC (permalink / raw)
  To: Wake Liu; +Cc: ltp

Hi,

This issue is alreday being discussed in this PR:
https://github.com/linux-test-project/ltp/pull/1340

Thanks,
Avinesh

On 8/24/26 10:56 AM, Wake Liu wrote:
> The parallel scenario concurrently spawns multiple workers (default 5),
> each creating 2,185 files and directories, totaling 10,925 objects.
> 
> On exfat, each file and directory occupies at least one cluster (default
> 32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.
> With filesystem metadata (FAT, allocation bitmap, upcase table),
> directory growth, boundary alignment, and multi-worker concurrent
> allocation fragmentation, the current 512 MB device size is easily
> exhausted, leading to ENOSPC failures during write() or mkdir():
> 
>    inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
>    inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)
> 
> Increase dev_min_size to 1024 MB to provide sufficient headroom for the
> parallel scenario on exfat.
> 
> Fixes: ecf418722780 ("inode01: increase dev_min_size to fit the peak usage in parallel scenario")
> Signed-off-by: Wake Liu <wakel@google.com>
> ---
>   testcases/kernel/fs/inode/inode01.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c
> index d41ff2c62..87ee07612 100644
> --- a/testcases/kernel/fs/inode/inode01.c
> +++ b/testcases/kernel/fs/inode/inode01.c
> @@ -68,7 +68,7 @@ static void create_tree(const struct tcase *tc, const char *parent,
>   }
>   
>   static void record_inode(struct inode_info *inodes, unsigned int idx,
> -			 const char *path, ino_t ino)
> +			 const char *path, uint64_t ino)
>   {
>   	inodes[idx].ino = ino;
>   	snprintf(inodes[idx].path, sizeof(inodes[idx].path), "%s", path);
> @@ -256,7 +256,7 @@ static struct tst_test test = {
>   	.mount_device = 1,
>   	.all_filesystems = 1,
>   	.needs_root = 1,
> -	.dev_min_size = 512,
> +	.dev_min_size = 1024,
>   	.forks_child = 1,
>   	.needs_checkpoints = 1,
>   	.timeout = 300,


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
  2026-08-24 10:18 ` Avinesh Kumar via ltp
@ 2026-08-25  7:38   ` Wake Liu via ltp
  0 siblings, 0 replies; 6+ messages in thread
From: Wake Liu via ltp @ 2026-08-25  7:38 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Got it, thanks!

On Mon, Aug 24, 2026 at 6:18 PM Avinesh Kumar <avinesh.kumar@suse.com> wrote:
>
> Hi,
>
> This issue is alreday being discussed in this PR:
> https://github.com/linux-test-project/ltp/pull/1340
>
> Thanks,
> Avinesh
>
> On 8/24/26 10:56 AM, Wake Liu wrote:
> > The parallel scenario concurrently spawns multiple workers (default 5),
> > each creating 2,185 files and directories, totaling 10,925 objects.
> >
> > On exfat, each file and directory occupies at least one cluster (default
> > 32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.
> > With filesystem metadata (FAT, allocation bitmap, upcase table),
> > directory growth, boundary alignment, and multi-worker concurrent
> > allocation fragmentation, the current 512 MB device size is easily
> > exhausted, leading to ENOSPC failures during write() or mkdir():
> >
> >    inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
> >    inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)
> >
> > Increase dev_min_size to 1024 MB to provide sufficient headroom for the
> > parallel scenario on exfat.
> >
> > Fixes: ecf418722780 ("inode01: increase dev_min_size to fit the peak usage in parallel scenario")
> > Signed-off-by: Wake Liu <wakel@google.com>
> > ---
> >   testcases/kernel/fs/inode/inode01.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c
> > index d41ff2c62..87ee07612 100644
> > --- a/testcases/kernel/fs/inode/inode01.c
> > +++ b/testcases/kernel/fs/inode/inode01.c
> > @@ -68,7 +68,7 @@ static void create_tree(const struct tcase *tc, const char *parent,
> >   }
> >
> >   static void record_inode(struct inode_info *inodes, unsigned int idx,
> > -                      const char *path, ino_t ino)
> > +                      const char *path, uint64_t ino)
> >   {
> >       inodes[idx].ino = ino;
> >       snprintf(inodes[idx].path, sizeof(inodes[idx].path), "%s", path);
> > @@ -256,7 +256,7 @@ static struct tst_test test = {
> >       .mount_device = 1,
> >       .all_filesystems = 1,
> >       .needs_root = 1,
> > -     .dev_min_size = 512,
> > +     .dev_min_size = 1024,
> >       .forks_child = 1,
> >       .needs_checkpoints = 1,
> >       .timeout = 300,
>


-- 
Best Regards,
Wake Liu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
@ 2026-08-28 11:41 Wake Liu via ltp
  2026-08-31  8:45 ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: Wake Liu via ltp @ 2026-08-28 11:41 UTC (permalink / raw)
  To: ltp; +Cc: Wake Liu

The parallel scenario concurrently spawns multiple workers (default 5),
each creating 2,185 files and directories, totaling 10,925 objects.

On exfat, each file and directory occupies at least one cluster (default
32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.
With filesystem metadata (FAT, allocation bitmap, upcase table),
directory growth, boundary alignment, and multi-worker concurrent
allocation fragmentation, the current 512 MB device size is easily
exhausted, leading to ENOSPC failures during write() or mkdir():

  inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
  inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)

Increase dev_min_size to 1024 MB to provide sufficient headroom for the
parallel scenario on exfat.

Fixes: ecf418722780 ("inode01: increase dev_min_size to fit the peak usage in parallel scenario")
Signed-off-by: Wake Liu <wakel@google.com>
---
 testcases/kernel/fs/inode/inode01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c
index 50b5311a4..87ee07612 100644
--- a/testcases/kernel/fs/inode/inode01.c
+++ b/testcases/kernel/fs/inode/inode01.c
@@ -256,7 +256,7 @@ static struct tst_test test = {
 	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_root = 1,
-	.dev_min_size = 512,
+	.dev_min_size = 1024,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
 	.timeout = 300,
-- 
2.55.0.897.gb25b4bd76c-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
  2026-08-28 11:41 [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat Wake Liu via ltp
@ 2026-08-31  8:45 ` Andrea Cervesato via ltp
  2026-09-01  9:55   ` Wake Liu via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-08-31  8:45 UTC (permalink / raw)
  To: Wake Liu; +Cc: ltp

Hi Wake,

the agent couldn't complete because patch didn't apply, so I will
send you the complete review from a local instance.

On Aug 31, 2026, Wake Liu wrote:
> inode01: Increase dev_min_size to prevent ENOSPC on exfat

> On exfat, each file and directory occupies at least one cluster (default
> 32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.

The test does not let mkfs.exfat pick the default cluster size. Master
already forces 4 KB:

	.filesystems = (struct tst_fs[]) {
		{.type = "exfat", .mkfs_opts = (const char *const[]) {"-c", "4K", NULL}},
		{}
	},

That comes from 4bf4da8c6fda ("inode01: Configure 4KB cluster size on
exfat to prevent ENOSPC"), merged on 2026-08-13, which targets this
exact ENOSPC.

So the "default 32 KB" premise does not hold here and the ~350 MB figure
does not follow.

> The parallel scenario concurrently spawns multiple workers (default 5),
> each creating 2,185 files and directories, totaling 10,925 objects.

The object count matches. With depth=6 fanout=6 each level creates 3
dirs and 3 files, and the 3 dirs recurse, giving 2184 objects plus the
per-worker root created at inode01.c:214, so 2185 per worker and 10925
in total.

But at the 4 KB cluster size actually in use that is ~43 MB, not
~350 MB. Each file holds repetitions=8 records of strlen(path) bytes
(inode01.c:60-61), well under one cluster, and each directory holds only
6 entries, so every object costs exactly one cluster.

512 MB leaves roughly an order of magnitude of headroom.

>   inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
>   inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)

This is the same file and the same two line numbers as the log already
quoted in ecf418722780. Was this reproduced on a tree that contains
4bf4da8c6fda?

If the failure is still real there, the numbers above say the cause is
not the cluster size, and doubling the device would hide it rather than
fix it. Could a fresh log be posted together with the geometry mkfs.exfat
actually produced (its output, or dumpexfat on the formatted device)?

> -	.dev_min_size = 512,
> +	.dev_min_size = 1024,

dev_min_size is not only the loop device size. With .all_filesystems = 1
tmpfs is also exercised (lib/tst_supported_fs_types.c:34), and the tmpfs
mount is sized from it (lib/tst_test.c:1246-1268):

	if (!tst_test->dev_min_size)
		tmpfs_size = 32;
	else
		tmpfs_size = tdev.size;

	if ((tst_available_mem() / 1024) < (tmpfs_size * 2))
		tst_brk(TCONF, "No enough memory for tmpfs use");

tdev.size is the acquired device size (lib/tst_test.c:1573), so this
raises the available-memory requirement from 1 GB to 2 GB.

That tst_brk() runs inside prepare_device(), which run_tcase_on_fs()
calls in the parent before fork_testrun() (lib/tst_test.c:1984-1997), so
it aborts the whole run rather than skipping the tmpfs pass.

There is no per-filesystem way out either: dev_min_size is global, and
struct tst_fs.mkfs_size_opt can only limit a filesystem below the device
size (include/tst_test.h:267-270).

Given the ~43 MB actual footprint, is this cost intended?

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat
  2026-08-31  8:45 ` Andrea Cervesato via ltp
@ 2026-09-01  9:55   ` Wake Liu via ltp
  0 siblings, 0 replies; 6+ messages in thread
From: Wake Liu via ltp @ 2026-09-01  9:55 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: ltp

Hey Andrea,

Thanks for catching this and for the detailed review!

Ah, my apologies—I was working off an outdated tree and missed
4bf4da8c6fda. With 4KB clusters already in place, this patch is
definitely redundant and would only unnecessarily inflate the tmpfs
memory requirement.

Let's go ahead and drop this one. Thanks again for looking into it!

Best,
Wake


On Mon, Aug 31, 2026 at 4:45 PM Andrea Cervesato
<andrea.cervesato@suse.com> wrote:
>
> Hi Wake,
>
> the agent couldn't complete because patch didn't apply, so I will
> send you the complete review from a local instance.
>
> On Aug 31, 2026, Wake Liu wrote:
> > inode01: Increase dev_min_size to prevent ENOSPC on exfat
>
> > On exfat, each file and directory occupies at least one cluster (default
> > 32 KB for volumes > 256 MB), which requires ~350 MB of data clusters.
>
> The test does not let mkfs.exfat pick the default cluster size. Master
> already forces 4 KB:
>
>         .filesystems = (struct tst_fs[]) {
>                 {.type = "exfat", .mkfs_opts = (const char *const[]) {"-c", "4K", NULL}},
>                 {}
>         },
>
> That comes from 4bf4da8c6fda ("inode01: Configure 4KB cluster size on
> exfat to prevent ENOSPC"), merged on 2026-08-13, which targets this
> exact ENOSPC.
>
> So the "default 32 KB" premise does not hold here and the ~350 MB figure
> does not follow.
>
> > The parallel scenario concurrently spawns multiple workers (default 5),
> > each creating 2,185 files and directories, totaling 10,925 objects.
>
> The object count matches. With depth=6 fanout=6 each level creates 3
> dirs and 3 files, and the 3 dirs recurse, giving 2184 objects plus the
> per-worker root created at inode01.c:214, so 2185 per worker and 10925
> in total.
>
> But at the 4 KB cluster size actually in use that is ~43 MB, not
> ~350 MB. Each file holds repetitions=8 records of strlen(path) bytes
> (inode01.c:60-61), well under one cluster, and each directory holds only
> 6 entries, so every object costs exactly one cluster.
>
> 512 MB leaves roughly an order of magnitude of headroom.
>
> >   inode01.c:61: TBROK: write(3,...) failed: ENOSPC (28)
> >   inode01.c:64: TBROK: mkdir(...) failed: ENOSPC (28)
>
> This is the same file and the same two line numbers as the log already
> quoted in ecf418722780. Was this reproduced on a tree that contains
> 4bf4da8c6fda?
>
> If the failure is still real there, the numbers above say the cause is
> not the cluster size, and doubling the device would hide it rather than
> fix it. Could a fresh log be posted together with the geometry mkfs.exfat
> actually produced (its output, or dumpexfat on the formatted device)?
>
> > -     .dev_min_size = 512,
> > +     .dev_min_size = 1024,
>
> dev_min_size is not only the loop device size. With .all_filesystems = 1
> tmpfs is also exercised (lib/tst_supported_fs_types.c:34), and the tmpfs
> mount is sized from it (lib/tst_test.c:1246-1268):
>
>         if (!tst_test->dev_min_size)
>                 tmpfs_size = 32;
>         else
>                 tmpfs_size = tdev.size;
>
>         if ((tst_available_mem() / 1024) < (tmpfs_size * 2))
>                 tst_brk(TCONF, "No enough memory for tmpfs use");
>
> tdev.size is the acquired device size (lib/tst_test.c:1573), so this
> raises the available-memory requirement from 1 GB to 2 GB.
>
> That tst_brk() runs inside prepare_device(), which run_tcase_on_fs()
> calls in the parent before fork_testrun() (lib/tst_test.c:1984-1997), so
> it aborts the whole run rather than skipping the tmpfs pass.
>
> There is no per-filesystem way out either: dev_min_size is global, and
> struct tst_fs.mkfs_size_opt can only limit a filesystem below the device
> size (include/tst_test.h:267-270).
>
> Given the ~43 MB actual footprint, is this cost intended?
>
> Verdict - Needs revision
>
> ---
> Note:
>
> The agent can sometimes produce false positives although often its
> findings are genuine. If you find issues with the review, please
> comment this email or ignore the suggestions.
>
> Regards,
> LTP AI Reviewer



-- 
Best Regards,
Wake Liu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-01  9:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 11:41 [LTP] [PATCH] inode01: Increase dev_min_size to prevent ENOSPC on exfat Wake Liu via ltp
2026-08-31  8:45 ` Andrea Cervesato via ltp
2026-09-01  9:55   ` Wake Liu via ltp
  -- strict thread matches above, loose matches on Subject: below --
2026-08-24  8:56 Wake Liu via ltp
2026-08-24 10:18 ` Avinesh Kumar via ltp
2026-08-25  7:38   ` Wake Liu via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox