<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/fat, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'vfs-7.4-rc3.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs</title>
<updated>2026-11-12T00:48:56+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-12T00:48:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d66f26fefacebfeed15de31c1123451a17ff119'/>
<id>9d66f26fefacebfeed15de31c1123451a17ff119</id>
<content type='text'>
Pull more vfs fixes from Christian Brauner:

 - inode: Let the shrinker reclaim inodes with I_METADATA_WRITEBACK like
   any other clean inode and have evict() write out what the bit tracks
   unless the inode is being deleted.

   Since v7.3 ext2, ext4 without a journal, fat, udf and minix set
   I_METADATA_WRITEBACK when they copy an inode into its buffer and only
   fsync() and friends clear it again. inode_lru_isolate() took such
   inodes off the LRU expecting something to put them back once the bit
   was gone but nothing ever did. So they couldn't be reclaimed until
   something fsynced them or the filesystem was unmounted.

   On ext4 without a journal an atime update was enough to pin an inode,
   and creating 60000 small files in a memory cgroup limited to 96M got
   the task OOM killed after about 43000 of them. Now all 60000 get
   created.

 - dcache:

     - Give d_set_mounted() a seqlock of its own that d_invalidate()
       waits on after unhashing the dentry.

       Since v6.17 d_set_mounted() doesn't bump the seqcount of
       rename_lock anymore, so a mount racing d_invalidate() could end
       up below the unhashed directory. Nobody can reach it there and it
       pins the subtree until the mount namespace goes away. With a FUSE
       directory 3000 levels deep 151 of 200 bind mounts racing
       FUSE_NOTIFY_INVAL_ENTRY ended up there.

     - Only take busy secondary roots off -&gt;s_roots in do_one_tree() so
       that umount waits for a racing eviction of an idle one. Since
       v7.3 it didn't, which ended in busy inodes after unmount and an
       iput() on a dead superblock.

     - Make a disconnected dentry a secondary root when the mount on it
       goes away so that umount finds it and waits for its eviction.
       With CAP_DAC_READ_SEARCH such a dentry can be mounted on via
       open_by_handle_at() and move_mount() and umount racing its
       eviction ended the same way.

 - splice:

     - Remove pipe buffer stealing as you and David suggested.

       fuse and virtio_console were the only users of -&gt;try_steal() and
       now always copy, as they already did when a steal failed.
       Stealing took page cache folios out of their files and turned
       pages into page cache folios and back. SPLICE_F_GIFT and
       SPLICE_F_MOVE are still accepted and fuse still advertises
       FUSE_SPLICE_MOVE so servers that ask for it mount as before.

     - Clamp a -&gt;write_iter() result that is larger than the iterator in
       iter_file_splice_write() instead of only warning about it.
       Otherwise the pipe releases buffers past its head.

 - ns:

     -Allocate the namespace id before calling the namespace_init LSM
      hook that was added this merge window. Landlock now logs the
      allocated id instead of zero when it denies the creation of a
      namespace.

     -Don't mark the arguments of the namespace_init and namespace_free
      hooks as trusted for bpf LSM programs. Both see namespaces that
      are only partially set up or on their way out.

 - proc: Don't let proc_sys_call_handler() report more bytes written
   than it was passed when a cgroup/sysctl bpf program replaced the
   value with a longer one. A splice() into the sysctl file then walked
   past the pipe head.

 - coda: Pass the append state of each write on to the container file
   with RWF_APPEND or RWF_NOAPPEND. coda_open() sets O_APPEND on the
   container file after its iocb flags were cached, so an O_APPEND write
   overwrote existing data instead of appending.

 - adfs: Reject big directory entries in adfs_fplus_getnext() whose name
   doesn't fit into the name buffer. A crafted image overflowed it on
   the stack.

* tag 'vfs-7.4-rc3.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits)
  nstree: drop ns_tree_add_raw()
  ns: allocate the namespace id before the namespace_init hook
  bpf: don't mark namespace_init and namespace_free arguments as trusted
  splice: replace nosteal_pipe_buf_ops with default_pipe_buf_ops
  splice: remove pipe buffer stealing
  fuse: don't move pipe buffers into the page cache
  virtio_console: copy pipe buffers in splice_write()
  fs/adfs: bound directory entry name length in adfs_fplus_getnext()
  dcache: let umount find a disconnected ex-mountpoint
  dcache: wait for a racing eviction of a secondary root
  dcache: let d_invalidate() wait for a d_set_mounted() in flight
  fat: drop mmb_sync() from fat_evict_inode()
  udf: drop mmb_sync() from udf_evict_inode()
  minix: drop mmb_sync() from minix_evict_inode()
  ext4: drop mmb_sync() from ext4_evict_inode()
  ext2: drop mmb_sync() from ext2_evict_inode()
  fs: don't strand I_METADATA_WRITEBACK inodes outside the LRU
  fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty()
  udf: don't allocate the inode block in udf_sync_inode_metadata()
  minix: don't read the inode block in minix_sync_inode_metadata()
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull more vfs fixes from Christian Brauner:

 - inode: Let the shrinker reclaim inodes with I_METADATA_WRITEBACK like
   any other clean inode and have evict() write out what the bit tracks
   unless the inode is being deleted.

   Since v7.3 ext2, ext4 without a journal, fat, udf and minix set
   I_METADATA_WRITEBACK when they copy an inode into its buffer and only
   fsync() and friends clear it again. inode_lru_isolate() took such
   inodes off the LRU expecting something to put them back once the bit
   was gone but nothing ever did. So they couldn't be reclaimed until
   something fsynced them or the filesystem was unmounted.

   On ext4 without a journal an atime update was enough to pin an inode,
   and creating 60000 small files in a memory cgroup limited to 96M got
   the task OOM killed after about 43000 of them. Now all 60000 get
   created.

 - dcache:

     - Give d_set_mounted() a seqlock of its own that d_invalidate()
       waits on after unhashing the dentry.

       Since v6.17 d_set_mounted() doesn't bump the seqcount of
       rename_lock anymore, so a mount racing d_invalidate() could end
       up below the unhashed directory. Nobody can reach it there and it
       pins the subtree until the mount namespace goes away. With a FUSE
       directory 3000 levels deep 151 of 200 bind mounts racing
       FUSE_NOTIFY_INVAL_ENTRY ended up there.

     - Only take busy secondary roots off -&gt;s_roots in do_one_tree() so
       that umount waits for a racing eviction of an idle one. Since
       v7.3 it didn't, which ended in busy inodes after unmount and an
       iput() on a dead superblock.

     - Make a disconnected dentry a secondary root when the mount on it
       goes away so that umount finds it and waits for its eviction.
       With CAP_DAC_READ_SEARCH such a dentry can be mounted on via
       open_by_handle_at() and move_mount() and umount racing its
       eviction ended the same way.

 - splice:

     - Remove pipe buffer stealing as you and David suggested.

       fuse and virtio_console were the only users of -&gt;try_steal() and
       now always copy, as they already did when a steal failed.
       Stealing took page cache folios out of their files and turned
       pages into page cache folios and back. SPLICE_F_GIFT and
       SPLICE_F_MOVE are still accepted and fuse still advertises
       FUSE_SPLICE_MOVE so servers that ask for it mount as before.

     - Clamp a -&gt;write_iter() result that is larger than the iterator in
       iter_file_splice_write() instead of only warning about it.
       Otherwise the pipe releases buffers past its head.

 - ns:

     -Allocate the namespace id before calling the namespace_init LSM
      hook that was added this merge window. Landlock now logs the
      allocated id instead of zero when it denies the creation of a
      namespace.

     -Don't mark the arguments of the namespace_init and namespace_free
      hooks as trusted for bpf LSM programs. Both see namespaces that
      are only partially set up or on their way out.

 - proc: Don't let proc_sys_call_handler() report more bytes written
   than it was passed when a cgroup/sysctl bpf program replaced the
   value with a longer one. A splice() into the sysctl file then walked
   past the pipe head.

 - coda: Pass the append state of each write on to the container file
   with RWF_APPEND or RWF_NOAPPEND. coda_open() sets O_APPEND on the
   container file after its iocb flags were cached, so an O_APPEND write
   overwrote existing data instead of appending.

 - adfs: Reject big directory entries in adfs_fplus_getnext() whose name
   doesn't fit into the name buffer. A crafted image overflowed it on
   the stack.

* tag 'vfs-7.4-rc3.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits)
  nstree: drop ns_tree_add_raw()
  ns: allocate the namespace id before the namespace_init hook
  bpf: don't mark namespace_init and namespace_free arguments as trusted
  splice: replace nosteal_pipe_buf_ops with default_pipe_buf_ops
  splice: remove pipe buffer stealing
  fuse: don't move pipe buffers into the page cache
  virtio_console: copy pipe buffers in splice_write()
  fs/adfs: bound directory entry name length in adfs_fplus_getnext()
  dcache: let umount find a disconnected ex-mountpoint
  dcache: wait for a racing eviction of a secondary root
  dcache: let d_invalidate() wait for a d_set_mounted() in flight
  fat: drop mmb_sync() from fat_evict_inode()
  udf: drop mmb_sync() from udf_evict_inode()
  minix: drop mmb_sync() from minix_evict_inode()
  ext4: drop mmb_sync() from ext4_evict_inode()
  ext2: drop mmb_sync() from ext2_evict_inode()
  fs: don't strand I_METADATA_WRITEBACK inodes outside the LRU
  fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty()
  udf: don't allocate the inode block in udf_sync_inode_metadata()
  minix: don't read the inode block in minix_sync_inode_metadata()
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: drop mmb_sync() from fat_evict_inode()</title>
<updated>2026-11-11T10:59:25+00:00</updated>
<author>
<name>Christian Brauner</name>
<email>brauner@kernel.org</email>
</author>
<published>2026-11-09T16:51:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a5ef6d6deed263a3e37eee1429788777e4403a7b'/>
<id>a5ef6d6deed263a3e37eee1429788777e4403a7b</id>
<content type='text'>
evict() writes out what I_METADATA_WRITEBACK tracks before it calls
-&gt;evict_inode() and since mmb_mark_buffer_dirty() sets the bit that
includes the tracked metadata buffers. So there's nothing left for
fat_evict_inode() to sync. The write-out happens before
fat_free_eofblocks() updates the directory entry again, so that update
stays as asynchronous as it is now.

Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-14-91ac6c024018@kernel.org
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Christian Brauner (Amutable) &lt;brauner@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
evict() writes out what I_METADATA_WRITEBACK tracks before it calls
-&gt;evict_inode() and since mmb_mark_buffer_dirty() sets the bit that
includes the tracked metadata buffers. So there's nothing left for
fat_evict_inode() to sync. The write-out happens before
fat_free_eofblocks() updates the directory entry again, so that update
stays as asynchronous as it is now.

Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-14-91ac6c024018@kernel.org
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Christian Brauner (Amutable) &lt;brauner@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: fix parent link count when replacing a sibling directory</title>
<updated>2026-11-03T03:18:58+00:00</updated>
<author>
<name>Hungyu Lin</name>
<email>dennylin0707@gmail.com</email>
</author>
<published>2026-10-30T06:00:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6cd4c2736c659397bd6c6d9e3cffd8211afcb60b'/>
<id>6cd4c2736c659397bd6c6d9e3cffd8211afcb60b</id>
<content type='text'>
vfat_rename() and do_msdos_rename() adjust parent link counts only when
updating the dotdot entry for a move between different parents.  Replacing
an existing empty directory in the same parent also removes a
subdirectory, but leaves the parent's link count unchanged.

For example, renaming one of two sibling directories over the other leaves
the parent with four links instead of three.  stat and ls report the stale
count, and find -links 3 does not match the parent.

Drop the parent's link count for this case after the source entry has been
removed successfully.  Leave cross-parent renames, regular files and the
existing error paths unchanged.

Share the parent link count check with rmdir through fat_dir_drop_nlink().
Only decrement counts of at least three and report a filesystem error
otherwise, rather than reducing a corrupted directory's count below two. 
Export the helper for the VFAT and MSDOS modules.

Link: https://lore.kernel.org/20261030060011.70237-1-dennylin0707@gmail.com
Signed-off-by: Hungyu Lin &lt;dennylin0707@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vfat_rename() and do_msdos_rename() adjust parent link counts only when
updating the dotdot entry for a move between different parents.  Replacing
an existing empty directory in the same parent also removes a
subdirectory, but leaves the parent's link count unchanged.

For example, renaming one of two sibling directories over the other leaves
the parent with four links instead of three.  stat and ls report the stale
count, and find -links 3 does not match the parent.

Drop the parent's link count for this case after the source entry has been
removed successfully.  Leave cross-parent renames, regular files and the
existing error paths unchanged.

Share the parent link count check with rmdir through fat_dir_drop_nlink().
Only decrement counts of at least three and report a filesystem error
otherwise, rather than reducing a corrupted directory's count below two. 
Export the helper for the VFAT and MSDOS modules.

Link: https://lore.kernel.org/20261030060011.70237-1-dennylin0707@gmail.com
Signed-off-by: Hungyu Lin &lt;dennylin0707@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: hold truncate_lock in fat_write_failed()</title>
<updated>2026-11-03T03:18:56+00:00</updated>
<author>
<name>Matheus Alves de Almeida</name>
<email>matheus.aalmeida@inf.ufrgs.br</email>
</author>
<published>2026-10-21T16:21:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b90009546f5d3f3ac9428040cd7ffbdfd60f2eb'/>
<id>7b90009546f5d3f3ac9428040cd7ffbdfd60f2eb</id>
<content type='text'>
The current fat_write_failed() implementation calls into
fat_truncate_blocks() without holding truncate_lock.

A failed or short extending write racing with FIBMAP can spuriously make a
FAT filesystem read-only.  FIBMAP bounds its lookup by i_blocks, so it can
walk allocated clusters beyond i_size while fat_write_failed() is removing
them.  If the chain is shortened during the walk, the mapper can report a
bogus "request beyond EOF" error, triggering the default read-only error
policy.  Hold truncate_lock for write around the block cleanup to
serialize it with _fat_bmap().

For comparison, fat_setattr() correctly holds truncate_lock during
truncation:

	down_write(&amp;MSDOS_I(inode)-&gt;truncate_lock);
	truncate_setsize(inode, attr-&gt;ia_size);
	fat_truncate_blocks(inode, attr-&gt;ia_size);
	up_write(&amp;MSDOS_I(inode)-&gt;truncate_lock);

Make it so -&gt;truncate_lock is held exclusive while truncating.

Link: https://lore.kernel.org/20261021162105.62525-1-matheus.aalmeida@inf.ufrgs.br
Fixes: 16fab2015099 ("fat: permit to return phy block number by fibmap in fallocated region")
Fixes: 459f6ed3b8c7 ("fat: convert to use the new truncate convention.")
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current fat_write_failed() implementation calls into
fat_truncate_blocks() without holding truncate_lock.

A failed or short extending write racing with FIBMAP can spuriously make a
FAT filesystem read-only.  FIBMAP bounds its lookup by i_blocks, so it can
walk allocated clusters beyond i_size while fat_write_failed() is removing
them.  If the chain is shortened during the walk, the mapper can report a
bogus "request beyond EOF" error, triggering the default read-only error
policy.  Hold truncate_lock for write around the block cleanup to
serialize it with _fat_bmap().

For comparison, fat_setattr() correctly holds truncate_lock during
truncation:

	down_write(&amp;MSDOS_I(inode)-&gt;truncate_lock);
	truncate_setsize(inode, attr-&gt;ia_size);
	fat_truncate_blocks(inode, attr-&gt;ia_size);
	up_write(&amp;MSDOS_I(inode)-&gt;truncate_lock);

Make it so -&gt;truncate_lock is held exclusive while truncating.

Link: https://lore.kernel.org/20261021162105.62525-1-matheus.aalmeida@inf.ufrgs.br
Fixes: 16fab2015099 ("fat: permit to return phy block number by fibmap in fallocated region")
Fixes: 459f6ed3b8c7 ("fat: convert to use the new truncate convention.")
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: preallocate space before expanding in fat_cont_expand()</title>
<updated>2026-11-03T03:18:55+00:00</updated>
<author>
<name>Matheus Alves de Almeida</name>
<email>matheus.aalmeida@inf.ufrgs.br</email>
</author>
<published>2026-10-24T01:30:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4bdfe8dd2342f9c2bdc3b788699164ebe21d9126'/>
<id>4bdfe8dd2342f9c2bdc3b788699164ebe21d9126</id>
<content type='text'>
The fat_cont_expand() implementation leaves allocation of new clusters
to generic_cont_expand_simple(). This path does many small cluster
allocations, harming performance.

Preallocate cluster space in fat_cont_expand(). Move preallocation to
a new fat_preallocate() helper used by both fat_cont_expand() and
fat_fallocate(FALLOC_FL_KEEP_SIZE). Use a FAT-specific
fat_cont_expand_simple() instead of generic_cont_expand_simple() to
avoid rechecking the new size after clusters have been allocated.

Benchmarking was done under QEMU/KVM with a virtio-blk device using
cache=none. Each result is the arithmetic mean of the listed samples.

start = now_ns();
for (unsigned i = 0; i &lt; count; i++) {
    if (truncate_mode)
        ftruncate(fds[i], bytes);
    else
        fallocate(fds[i], 0, 0, bytes);
}
elapsed = now_ns() - start;

16 files, 512-byte clusters:
length    mode      sync?    before    after    improvement    samples
256MiB    ftruncate no       9.576s    5.345s   1.79x          10
256MiB    fallocate no       9.634s    5.640s   1.71x          10
1MiB      ftruncate yes      58.66s    0.362s   162.15x        5
1MiB      fallocate yes      61.36s    0.390s   157.15x        5

128 files, 512-byte clusters:
length    mode      sync?    before    after    improvement    samples
512KiB    ftruncate no       0.433s    0.352s   1.23x          10
512KiB    fallocate no       0.446s    0.393s   1.13x          10
64KiB     ftruncate yes      31.32s    0.429s   73.00x         10
64KiB     fallocate yes      29.59s    0.410s   72.42x         10

16 files, 4096-byte clusters:
length    mode      sync?    before    after    improvement    samples
256MiB    ftruncate no       5.181s    4.417s   1.17x          10
256MiB    fallocate no       5.166s    4.442s   1.16x          10
1MiB      ftruncate yes      9.294s    0.111s   84.06x         10
1MiB      fallocate yes      8.710s    0.110s   79.36x         10

The biggest improvement is on filesystems with a small cluster size and
on synchronous mounts.

Link: https://lore.kernel.org/20261024013021.251898-1-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fat_cont_expand() implementation leaves allocation of new clusters
to generic_cont_expand_simple(). This path does many small cluster
allocations, harming performance.

Preallocate cluster space in fat_cont_expand(). Move preallocation to
a new fat_preallocate() helper used by both fat_cont_expand() and
fat_fallocate(FALLOC_FL_KEEP_SIZE). Use a FAT-specific
fat_cont_expand_simple() instead of generic_cont_expand_simple() to
avoid rechecking the new size after clusters have been allocated.

Benchmarking was done under QEMU/KVM with a virtio-blk device using
cache=none. Each result is the arithmetic mean of the listed samples.

start = now_ns();
for (unsigned i = 0; i &lt; count; i++) {
    if (truncate_mode)
        ftruncate(fds[i], bytes);
    else
        fallocate(fds[i], 0, 0, bytes);
}
elapsed = now_ns() - start;

16 files, 512-byte clusters:
length    mode      sync?    before    after    improvement    samples
256MiB    ftruncate no       9.576s    5.345s   1.79x          10
256MiB    fallocate no       9.634s    5.640s   1.71x          10
1MiB      ftruncate yes      58.66s    0.362s   162.15x        5
1MiB      fallocate yes      61.36s    0.390s   157.15x        5

128 files, 512-byte clusters:
length    mode      sync?    before    after    improvement    samples
512KiB    ftruncate no       0.433s    0.352s   1.23x          10
512KiB    fallocate no       0.446s    0.393s   1.13x          10
64KiB     ftruncate yes      31.32s    0.429s   73.00x         10
64KiB     fallocate yes      29.59s    0.410s   72.42x         10

16 files, 4096-byte clusters:
length    mode      sync?    before    after    improvement    samples
256MiB    ftruncate no       5.181s    4.417s   1.17x          10
256MiB    fallocate no       5.166s    4.442s   1.16x          10
1MiB      ftruncate yes      9.294s    0.111s   84.06x         10
1MiB      fallocate yes      8.710s    0.110s   79.36x         10

The biggest improvement is on filesystems with a small cluster size and
on synchronous mounts.

Link: https://lore.kernel.org/20261024013021.251898-1-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'mm-nonmm-stable-2026-10-25-14-57' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2026-10-27T22:08:22+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-10-27T22:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d1f84f1b94e79cb95d974ab3ec54cb3a4d64f5b'/>
<id>7d1f84f1b94e79cb95d974ab3ec54cb3a4d64f5b</id>
<content type='text'>
Pull non-MM updates from Andrew Morton:

 - "ocfs2: exit recovery thread on mount error path" (Joseph Qi):

   Stop OCFS2 recovery before freeing failed-mount state and replay
   slots, closing use-after-free and double-free races. Defer
   suballocator reclaim to break a transaction-lock deadlock with
   dismount.

 - "ocfs2: validate suballoc slot and bit of metadata blocks" (Joseph
   Qi):

   Validate OCFS2 metadata suballocator slots, bits and directory index
   block locations. Reject corrupt metadata with filesystem errors
   instead of BUGs or out-of-bounds accesses.

 - "ocfs2: deal with legacy signed name hash values" (Joseph Qi):

   Restore OCFS2 lookups for non-ASCII names stored with legacy signed
   hashes. Use stored xattr hashes during bucket splits to avoid
   duplicate entries and spurious ENOSPC failures.

 - "ocfs2: stabilize dentry names in file and setattr traces" (Cen
   Zhang):

   Snapshot OCFS2 names during file and setattr tracing to prevent
   rename races using freed storage or mismatched names and lengths.
   Preserve trace formats and the locked release open-count sample.

 - "panic: fix panic_force_cpu= redirect races and NMI bypass" (Bradley
   Morgan):

   Fix panic_force_cpu races and NMI redirection so crash-kernel CPU
   selection is honored. Preserve variable arguments on failed redirects
   and use a static message buffer.

 - "fat: allocate multiple clusters in fallocate" (Matheus Alves de
   Almeida):

   Allocate FAT clusters in batches for FALLOC_FL_KEEP_SIZE and batch
   FAT updates. This removes repeated single-cluster allocation
   overhead, particularly on synchronous mounts.

 - "scripts/gdb: fix radix tree lookup and stack depot diagnostic"
   (Ting-Han Hou):

   Fix GDB radix-tree lookup and its handling of XArray sibling, retry
   and zero entries. Also repair the stack-depot diagnostic for an
   out-of-range pool index.

 - "hung_task: Improve warning budget handling and task reporting"
   (Aaron Tomlin):

   Reset the hung-task warning budget after recovery so later hangs
   remain visible. Keep the configured limit intact and emit one summary
   per scan when detailed reports exhaust the budget.

 - "bootconfig: Reject unexpected data after null character and
   cleanups" (Masami Hiramatsu):

   Reject bootconfig data after an embedded null while accepting
   trailing padding. Validate the full input in the userspace tool, and
   retain internal tree sanity checks there rather than in the kernel.

 - "kbuild: GCOV cleanups following the prefer-atomic fix" (Konstantin
   Khorenko):

   Use the actual GCOV build flags in the prefer-atomic compiler probe.
   Move flag setup into scripts/Makefile.gcov and skip the probe when
   GCOV is disabled.

 - "ocfs2: xattr bucket validation fixes" (Joseph Qi):

   Accept valid OCFS2 xattr buckets spanning 512-byte blocks, avoiding
   false read-only remounts. Reject misaligned buckets and return errors
   instead of panicking on corrupt defrag metadata.

 - "ocfs2: fix metadata reservation for xattr value trees" (Joseph Qi):

   Reserve enough OCFS2 metadata for new and relocated xattr value
   trees. Fix shortfalls which could cause ENOSPC, dropped entries and
   leaked clusters on fragmented filesystems; remove duplicate
   reservations.

 - "Introduce arch_do_panic" (Mete Durlu):

   Add arch_do_panic() and move s390 and sparc handling out of generic
   panic code. The architecture-specific actions now follow the
   end-of-panic marker.

 - "checkpatch: userspace improvements" (Petr Vorel):

   Improve checkpatch's userspace detection and suppress kernel-only
   checks. Recognize standard inttypes macros and add explicit
   --userspace and --no-userspace overrides.

 - "ocfs2: validate dr_fs_generation of dir index root blocks" (Joseph
   Qi):

   Check OCFS2 directory index generations and leaf block numbers.
   Reject stale or misplaced blocks instead of using metadata left by a
   previously formatted filesystem.

 - "selftests/membarrier: Skip an unregistered memory barrier test on
   Musl" (Chris Gellermann):

   Skip the unregistered membarrier test when libc has already
   registered the command. Musl does this during thread creation,
   causing false failures in the multithreaded test.

 - "init: fix array boundary bugs in boot parameter parsing"
   (Wilson Felipe Pereira):

   Fix boot argument boundary cases which leave stale arguments in
   init's command line or panic when replacing the final environment
   variable. Clear the last slot and check duplicates before the limit.

Summary of the 87 singletons in this merge:

  The OCFS2 singletons fix deadlocks between xattr updates and inline
  truncation, and during inode reclaim. Corrupt quota and extent
  metadata could also crash the kernel or corrupt memory; these paths
  now check the layout before using it. Other fixes close use-after-free
  and publication races around cluster reconfiguration, node failure,
  quota remount errors and shared refcount trees. New files now retain
  security labels from all stacked LSMs instead of silently dropping all
  but one. Valid xattr insertions also stop tripping FORTIFY on builds
  with counted arrays.

  Elsewhere, a lost wakeup could leave hardware-monitoring reads stuck
  in unkillable sleep and block further I2C traffic. That is fixed, as
  are kernel memory leaks in POSIX message-queue notifications and tmpfs
  casefold setup which could grow until memory is exhausted. A driver
  removal race which could crash the kernel is fixed too. The
  hibernation command through reboot() also stops taking the same mutex
  twice, avoiding a deadlock before suspension.

  On the boot side, bzip2 decoding now accepts valid full blocks emitted
  by lbzip2, fixing failures to boot those compressed kernels. Malformed
  bzip2 streams can no longer overflow the decode buffer, and LZ4
  initrds are checked before the decoder can read past their end. FAT
  rejects geometry which overflows the data-area calculation on 32-bit
  systems, and rolls back entries when inode setup fails, preventing
  failed creations from reappearing after remount. The x86 XOR and RAID6
  AVX paths also avoid imposing a slowdown on subsequent SSE code.

* tag 'mm-nonmm-stable-2026-10-25-14-57' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (134 commits)
  scripts/gdb: fix stack depot out-of-bounds diagnostic
  scripts/gdb: fix radix tree lookup pointer handling
  ocfs2/cluster: remove zero-address nodes from IP tree on teardown
  ocfs2: snapshot the dentry name while tracing file release
  ocfs2: snapshot dentry names in file and setattr traces
  ocfs2/dlm: drain join handlers before releasing module text
  MAINTAINERS: update Markus's e-mail address
  mailmap: add entries for Andrew Jones
  stackdepot: stop preallocating after the final pool
  ocfs2: drain quorum work before removing the cluster
  watchdog: force console verbose when reporting lockups
  profiling: fix sampling step on 64-bit big-endian systems
  kernel/reboot: avoid potential deadlocks during suspension
  compat: avoid double rounding in times()
  ocfs2: pin owning modules for open debugfs files
  ocfs2/cluster: initialize heartbeat regions before publishing them
  selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
  ocfs2: pin refcount trees before dropping the lookup lock
  ocfs2: validate the xattr tree root of an indexed xattr block
  ocfs2/dlm: hold the lookup reference across convert AST enqueue
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull non-MM updates from Andrew Morton:

 - "ocfs2: exit recovery thread on mount error path" (Joseph Qi):

   Stop OCFS2 recovery before freeing failed-mount state and replay
   slots, closing use-after-free and double-free races. Defer
   suballocator reclaim to break a transaction-lock deadlock with
   dismount.

 - "ocfs2: validate suballoc slot and bit of metadata blocks" (Joseph
   Qi):

   Validate OCFS2 metadata suballocator slots, bits and directory index
   block locations. Reject corrupt metadata with filesystem errors
   instead of BUGs or out-of-bounds accesses.

 - "ocfs2: deal with legacy signed name hash values" (Joseph Qi):

   Restore OCFS2 lookups for non-ASCII names stored with legacy signed
   hashes. Use stored xattr hashes during bucket splits to avoid
   duplicate entries and spurious ENOSPC failures.

 - "ocfs2: stabilize dentry names in file and setattr traces" (Cen
   Zhang):

   Snapshot OCFS2 names during file and setattr tracing to prevent
   rename races using freed storage or mismatched names and lengths.
   Preserve trace formats and the locked release open-count sample.

 - "panic: fix panic_force_cpu= redirect races and NMI bypass" (Bradley
   Morgan):

   Fix panic_force_cpu races and NMI redirection so crash-kernel CPU
   selection is honored. Preserve variable arguments on failed redirects
   and use a static message buffer.

 - "fat: allocate multiple clusters in fallocate" (Matheus Alves de
   Almeida):

   Allocate FAT clusters in batches for FALLOC_FL_KEEP_SIZE and batch
   FAT updates. This removes repeated single-cluster allocation
   overhead, particularly on synchronous mounts.

 - "scripts/gdb: fix radix tree lookup and stack depot diagnostic"
   (Ting-Han Hou):

   Fix GDB radix-tree lookup and its handling of XArray sibling, retry
   and zero entries. Also repair the stack-depot diagnostic for an
   out-of-range pool index.

 - "hung_task: Improve warning budget handling and task reporting"
   (Aaron Tomlin):

   Reset the hung-task warning budget after recovery so later hangs
   remain visible. Keep the configured limit intact and emit one summary
   per scan when detailed reports exhaust the budget.

 - "bootconfig: Reject unexpected data after null character and
   cleanups" (Masami Hiramatsu):

   Reject bootconfig data after an embedded null while accepting
   trailing padding. Validate the full input in the userspace tool, and
   retain internal tree sanity checks there rather than in the kernel.

 - "kbuild: GCOV cleanups following the prefer-atomic fix" (Konstantin
   Khorenko):

   Use the actual GCOV build flags in the prefer-atomic compiler probe.
   Move flag setup into scripts/Makefile.gcov and skip the probe when
   GCOV is disabled.

 - "ocfs2: xattr bucket validation fixes" (Joseph Qi):

   Accept valid OCFS2 xattr buckets spanning 512-byte blocks, avoiding
   false read-only remounts. Reject misaligned buckets and return errors
   instead of panicking on corrupt defrag metadata.

 - "ocfs2: fix metadata reservation for xattr value trees" (Joseph Qi):

   Reserve enough OCFS2 metadata for new and relocated xattr value
   trees. Fix shortfalls which could cause ENOSPC, dropped entries and
   leaked clusters on fragmented filesystems; remove duplicate
   reservations.

 - "Introduce arch_do_panic" (Mete Durlu):

   Add arch_do_panic() and move s390 and sparc handling out of generic
   panic code. The architecture-specific actions now follow the
   end-of-panic marker.

 - "checkpatch: userspace improvements" (Petr Vorel):

   Improve checkpatch's userspace detection and suppress kernel-only
   checks. Recognize standard inttypes macros and add explicit
   --userspace and --no-userspace overrides.

 - "ocfs2: validate dr_fs_generation of dir index root blocks" (Joseph
   Qi):

   Check OCFS2 directory index generations and leaf block numbers.
   Reject stale or misplaced blocks instead of using metadata left by a
   previously formatted filesystem.

 - "selftests/membarrier: Skip an unregistered memory barrier test on
   Musl" (Chris Gellermann):

   Skip the unregistered membarrier test when libc has already
   registered the command. Musl does this during thread creation,
   causing false failures in the multithreaded test.

 - "init: fix array boundary bugs in boot parameter parsing"
   (Wilson Felipe Pereira):

   Fix boot argument boundary cases which leave stale arguments in
   init's command line or panic when replacing the final environment
   variable. Clear the last slot and check duplicates before the limit.

Summary of the 87 singletons in this merge:

  The OCFS2 singletons fix deadlocks between xattr updates and inline
  truncation, and during inode reclaim. Corrupt quota and extent
  metadata could also crash the kernel or corrupt memory; these paths
  now check the layout before using it. Other fixes close use-after-free
  and publication races around cluster reconfiguration, node failure,
  quota remount errors and shared refcount trees. New files now retain
  security labels from all stacked LSMs instead of silently dropping all
  but one. Valid xattr insertions also stop tripping FORTIFY on builds
  with counted arrays.

  Elsewhere, a lost wakeup could leave hardware-monitoring reads stuck
  in unkillable sleep and block further I2C traffic. That is fixed, as
  are kernel memory leaks in POSIX message-queue notifications and tmpfs
  casefold setup which could grow until memory is exhausted. A driver
  removal race which could crash the kernel is fixed too. The
  hibernation command through reboot() also stops taking the same mutex
  twice, avoiding a deadlock before suspension.

  On the boot side, bzip2 decoding now accepts valid full blocks emitted
  by lbzip2, fixing failures to boot those compressed kernels. Malformed
  bzip2 streams can no longer overflow the decode buffer, and LZ4
  initrds are checked before the decoder can read past their end. FAT
  rejects geometry which overflows the data-area calculation on 32-bit
  systems, and rolls back entries when inode setup fails, preventing
  failed creations from reappearing after remount. The x86 XOR and RAID6
  AVX paths also avoid imposing a slowdown on subsequent SSE code.

* tag 'mm-nonmm-stable-2026-10-25-14-57' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (134 commits)
  scripts/gdb: fix stack depot out-of-bounds diagnostic
  scripts/gdb: fix radix tree lookup pointer handling
  ocfs2/cluster: remove zero-address nodes from IP tree on teardown
  ocfs2: snapshot the dentry name while tracing file release
  ocfs2: snapshot dentry names in file and setattr traces
  ocfs2/dlm: drain join handlers before releasing module text
  MAINTAINERS: update Markus's e-mail address
  mailmap: add entries for Andrew Jones
  stackdepot: stop preallocating after the final pool
  ocfs2: drain quorum work before removing the cluster
  watchdog: force console verbose when reporting lockups
  profiling: fix sampling step on 64-bit big-endian systems
  kernel/reboot: avoid potential deadlocks during suspension
  compat: avoid double rounding in times()
  ocfs2: pin owning modules for open debugfs files
  ocfs2/cluster: initialize heartbeat regions before publishing them
  selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
  ocfs2: pin refcount trees before dropping the lookup lock
  ocfs2: validate the xattr tree root of an indexed xattr block
  ocfs2/dlm: hold the lookup reference across convert AST enqueue
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: allocate multiple clusters in fallocate</title>
<updated>2026-10-21T05:29:55+00:00</updated>
<author>
<name>Matheus Alves de Almeida</name>
<email>matheus.aalmeida@inf.ufrgs.br</email>
</author>
<published>2026-10-12T17:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8d40831419c451252e2fd328f59e1a54ed0061b7'/>
<id>8d40831419c451252e2fd328f59e1a54ed0061b7</id>
<content type='text'>
The fat_fallocate() code currently does many 1-cluster allocations when
growing a file in the FALLOC_FL_KEEP_SIZE path. Make it allocate
everything with one call instead.

Benchmarking was done under QEMU/KVM with a virtio-blk device using
cache=none. Each result is the arithmetic mean of the listed samples.

start = now_ns();
for (unsigned int i = 0; i &lt; count; i++)
     fallocate(fds[i], FALLOC_FL_KEEP_SIZE, 0, bytes);
elapsed = now_ns() - start;

FAT32 with 512-byte clusters using count=16 files:
length    mounted sync?    before    after    improvement    samples
256MiB    no               2.328s    0.175s   13.2x          10
16MiB     no               149.659ms 14.036ms 10.7x          10
16MiB     yes              747.993s  3.445s   217.1x         3
1MiB      yes              46.63s    0.333s   140.1x         10

FAT32 with 512-byte clusters using count=128 files:
length    mounted sync?    before    after    improvement    samples
1MiB      no               90.873ms  4.686ms  19.4x          10
16KiB     no               1.287ms   0.241ms  5.3x           10
128KiB    yes              47.284s   0.350s   135x           10
4KiB      yes              1.98s     0.144s   13.7x          10

FAT32 with 4096-byte clusters using count=16 files:
length    mounted sync?    before    after    improvement    samples
256MiB    no               295.392ms 24.733ms 11.9x          10
16MiB     no               20.509ms  1.404ms  14.6x          10
16MiB     yes              92.489s   0.348s   265.4x         10
1MiB      yes              5.837s    0.048s   121.3x         10

The improvement is especially large on synchronous mounts, where the
new code can batch FAT updates instead of synchronously handling each
cluster allocation separately.

Link: https://lore.kernel.org/20261012171106.146243-4-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fat_fallocate() code currently does many 1-cluster allocations when
growing a file in the FALLOC_FL_KEEP_SIZE path. Make it allocate
everything with one call instead.

Benchmarking was done under QEMU/KVM with a virtio-blk device using
cache=none. Each result is the arithmetic mean of the listed samples.

start = now_ns();
for (unsigned int i = 0; i &lt; count; i++)
     fallocate(fds[i], FALLOC_FL_KEEP_SIZE, 0, bytes);
elapsed = now_ns() - start;

FAT32 with 512-byte clusters using count=16 files:
length    mounted sync?    before    after    improvement    samples
256MiB    no               2.328s    0.175s   13.2x          10
16MiB     no               149.659ms 14.036ms 10.7x          10
16MiB     yes              747.993s  3.445s   217.1x         3
1MiB      yes              46.63s    0.333s   140.1x         10

FAT32 with 512-byte clusters using count=128 files:
length    mounted sync?    before    after    improvement    samples
1MiB      no               90.873ms  4.686ms  19.4x          10
16KiB     no               1.287ms   0.241ms  5.3x           10
128KiB    yes              47.284s   0.350s   135x           10
4KiB      yes              1.98s     0.144s   13.7x          10

FAT32 with 4096-byte clusters using count=16 files:
length    mounted sync?    before    after    improvement    samples
256MiB    no               295.392ms 24.733ms 11.9x          10
16MiB     no               20.509ms  1.404ms  14.6x          10
16MiB     yes              92.489s   0.348s   265.4x         10
1MiB      yes              5.837s    0.048s   121.3x         10

The improvement is especially large on synchronous mounts, where the
new code can batch FAT updates instead of synchronously handling each
cluster allocation separately.

Link: https://lore.kernel.org/20261012171106.146243-4-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: support adding multiple clusters</title>
<updated>2026-10-21T05:29:55+00:00</updated>
<author>
<name>Matheus Alves de Almeida</name>
<email>matheus.aalmeida@inf.ufrgs.br</email>
</author>
<published>2026-10-12T17:11:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2febfdc2b7f77d409f19af8d289a0cf7ff63dbc'/>
<id>d2febfdc2b7f77d409f19af8d289a0cf7ff63dbc</id>
<content type='text'>
fat_add_cluster() currently adds only one cluster to a file's chain,
requiring multiple calls when adding more clusters.

Add a fat_alloc_chain() helper that allocates a cluster chain
but only returns the first cluster. Extend fat_add_cluster()
to add multiple clusters in a single call and rename it to
fat_add_clusters() to reflect the new behavior.

Link: https://lore.kernel.org/20261012171106.146243-3-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fat_add_cluster() currently adds only one cluster to a file's chain,
requiring multiple calls when adding more clusters.

Add a fat_alloc_chain() helper that allocates a cluster chain
but only returns the first cluster. Extend fat_add_cluster()
to add multiple clusters in a single call and rename it to
fat_add_clusters() to reflect the new behavior.

Link: https://lore.kernel.org/20261012171106.146243-3-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: remove cluster allocation size limit</title>
<updated>2026-10-21T05:29:55+00:00</updated>
<author>
<name>Matheus Alves de Almeida</name>
<email>matheus.aalmeida@inf.ufrgs.br</email>
</author>
<published>2026-10-12T17:11:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=930256458a8a53b89466a3f90c82dbe554efeced'/>
<id>930256458a8a53b89466a3f90c82dbe554efeced</id>
<content type='text'>
Patch series "fat: allocate multiple clusters in fallocate", v2.

This series adds support for allocating multiple clusters in a single
fat_add_clusters() call in fat_fallocate().

The multi-cluster TODO in inode.c is not implemented, as doing so would
require speculative preallocation or an iomap conversion.


This patch (of 3):

fat_alloc_clusters() currently BUG()s when asked to allocate more than
MAX_BUF_PER_PAGE / 2 clusters. This limit comes from the buffer_head
array used to defer syncing and mirroring.

Remove the allocation size limit by doing buffer_head batching like
fat_free_clusters() does.

Link: https://lore.kernel.org/20261012171106.146243-1-matheus.aalmeida@inf.ufrgs.br
Link: https://lore.kernel.org/20261012171106.146243-2-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patch series "fat: allocate multiple clusters in fallocate", v2.

This series adds support for allocating multiple clusters in a single
fat_add_clusters() call in fat_fallocate().

The multi-cluster TODO in inode.c is not implemented, as doing so would
require speculative preallocation or an iomap conversion.


This patch (of 3):

fat_alloc_clusters() currently BUG()s when asked to allocate more than
MAX_BUF_PER_PAGE / 2 clusters. This limit comes from the buffer_head
array used to defer syncing and mirroring.

Remove the allocation size limit by doing buffer_head batching like
fat_free_clusters() does.

Link: https://lore.kernel.org/20261012171106.146243-1-matheus.aalmeida@inf.ufrgs.br
Link: https://lore.kernel.org/20261012171106.146243-2-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida &lt;matheus.aalmeida@inf.ufrgs.br&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: roll back the new entry when create/mkdir fails to build the inode</title>
<updated>2026-10-21T05:29:54+00:00</updated>
<author>
<name>zhoumin</name>
<email>teczm@foxmail.com</email>
</author>
<published>2026-10-12T13:20:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edb528227f55e7564febcf68ed2f1bf8045559a9'/>
<id>edb528227f55e7564febcf68ed2f1bf8045559a9</id>
<content type='text'>
vfat_create(), vfat_mkdir(), msdos_create() and msdos_mkdir() add the
on-disk entry before calling fat_build_inode() to set up the VFS inode. 
If fat_build_inode() fails, the error is returned but the entry stays on
disk and the file or directory shows up after remount.

Remove the entry in that case.  For mkdir, also free the directory cluster
and decrement the parent's link count.

[akpm@linux-foundation.org" export _fat_msg() to modules]
Link: https://lore.kernel.org/tencent_4EDD66523CED299DB0C99498B4D8C939A009@qq.com
Signed-off-by: zhoumin &lt;teczm@foxmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vfat_create(), vfat_mkdir(), msdos_create() and msdos_mkdir() add the
on-disk entry before calling fat_build_inode() to set up the VFS inode. 
If fat_build_inode() fails, the error is returned but the entry stays on
disk and the file or directory shows up after remount.

Remove the entry in that case.  For mkdir, also free the directory cluster
and decrement the parent's link count.

[akpm@linux-foundation.org" export _fat_msg() to modules]
Link: https://lore.kernel.org/tencent_4EDD66523CED299DB0C99498B4D8C939A009@qq.com
Signed-off-by: zhoumin &lt;teczm@foxmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
</pre>
</div>
</content>
</entry>
</feed>
