<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4, branch v6.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-08-18T16:01:00Z</updated>
<entry>
<title>Merge tag 'ext4_for_linus-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4</title>
<updated>2025-08-18T16:01:00Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-08-18T16:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=074e461d9ed5bbd393a76ae42caa2a5a55add23b'/>
<id>urn:sha1:074e461d9ed5bbd393a76ae42caa2a5a55add23b</id>
<content type='text'>
Pull ext4 fixes from Ted Ts'o:

 - Fix fast commit checks for file systems with ea_inode enabled

 - Don't drop the i_version mount option on a remount

 - Fix FIEMAP reporting when there are holes in a bigalloc file system

 - Don't fail when mounting read-only when there are inodes in the
   orphan file

 - Fix hole length overflow for indirect mapped files on file systems
   with an 8k or 16k block file system

* tag 'ext4_for_linus-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  jbd2: prevent softlockup in jbd2_log_do_checkpoint()
  ext4: fix incorrect function name in comment
  ext4: use kmalloc_array() for array space allocation
  ext4: fix hole length calculation overflow in non-extent inodes
  ext4: don't try to clear the orphan_present feature block device is r/o
  ext4: fix reserved gdt blocks handling in fsmap
  ext4: fix fsmap end of range reporting with bigalloc
  ext4: remove redundant __GFP_NOWARN
  ext4: fix unused variable warning in ext4_init_new_dir
  ext4: remove useless if check
  ext4: check fast symlink for ea_inode correctly
  ext4: preserve SB_I_VERSION on remount
  ext4: show the default enabled i_version option
</content>
</entry>
<entry>
<title>ext4: fix incorrect function name in comment</title>
<updated>2025-08-13T18:18:50Z</updated>
<author>
<name>Baolin Liu</name>
<email>liubaolin@kylinos.cn</email>
</author>
<published>2025-08-12T02:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=757fc66da91b54d4fbc414bee5c440b52560d3b7'/>
<id>urn:sha1:757fc66da91b54d4fbc414bee5c440b52560d3b7</id>
<content type='text'>
Since commit 6b730a405037 “ext4: hoist ext4_block_write_begin and
replace the __block_write_begin”, the comment should be updated
accordingly from "__block_write_begin" to "ext4_block_write_begin".

Fixes: 6b730a405037 (“ext4: hoist ext4_block_write_begin and replace...")
Signed-off-by: Baolin Liu &lt;liubaolin@kylinos.cn&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Link: https://patch.msgid.link/20250812021709.1120716-1-liubaolin12138@163.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: use kmalloc_array() for array space allocation</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Liao Yuanhong</name>
<email>liaoyuanhong@vivo.com</email>
</author>
<published>2025-08-11T12:58:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76dba1fe277f6befd6ef650e1946f626c547387a'/>
<id>urn:sha1:76dba1fe277f6befd6ef650e1946f626c547387a</id>
<content type='text'>
Replace kmalloc(size * sizeof) with kmalloc_array() for safer memory
allocation and overflow prevention.

Cc: stable@kernel.org
Signed-off-by: Liao Yuanhong &lt;liaoyuanhong@vivo.com&gt;
Link: https://patch.msgid.link/20250811125816.570142-1-liaoyuanhong@vivo.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix hole length calculation overflow in non-extent inodes</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Zhang Yi</name>
<email>yi.zhang@huawei.com</email>
</author>
<published>2025-08-11T06:45:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=02c7f7219ac0e2277b3379a3a0e9841ef464b6d4'/>
<id>urn:sha1:02c7f7219ac0e2277b3379a3a0e9841ef464b6d4</id>
<content type='text'>
In a filesystem with a block size larger than 4KB, the hole length
calculation for a non-extent inode in ext4_ind_map_blocks() can easily
exceed INT_MAX. Then it could return a zero length hole and trigger the
following waring and infinite in the iomap infrastructure.

  ------------[ cut here ]------------
  WARNING: CPU: 3 PID: 434101 at fs/iomap/iter.c:34 iomap_iter_done+0x148/0x190
  CPU: 3 UID: 0 PID: 434101 Comm: fsstress Not tainted 6.16.0-rc7+ #128 PREEMPT(voluntary)
  Hardware name: QEMU KVM Virtual Machine, BIOS unknown 2/2/2022
  pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : iomap_iter_done+0x148/0x190
  lr : iomap_iter+0x174/0x230
  sp : ffff8000880af740
  x29: ffff8000880af740 x28: ffff0000db8e6840 x27: 0000000000000000
  x26: 0000000000000000 x25: ffff8000880af830 x24: 0000004000000000
  x23: 0000000000000002 x22: 000001bfdbfa8000 x21: ffffa6a41c002e48
  x20: 0000000000000001 x19: ffff8000880af808 x18: 0000000000000000
  x17: 0000000000000000 x16: ffffa6a495ee6cd0 x15: 0000000000000000
  x14: 00000000000003d4 x13: 00000000fa83b2da x12: 0000b236fc95f18c
  x11: ffffa6a4978b9c08 x10: 0000000000001da0 x9 : ffffa6a41c1a2a44
  x8 : ffff8000880af5c8 x7 : 0000000001000000 x6 : 0000000000000000
  x5 : 0000000000000004 x4 : 000001bfdbfa8000 x3 : 0000000000000000
  x2 : 0000000000000000 x1 : 0000004004030000 x0 : 0000000000000000
  Call trace:
   iomap_iter_done+0x148/0x190 (P)
   iomap_iter+0x174/0x230
   iomap_fiemap+0x154/0x1d8
   ext4_fiemap+0x110/0x140 [ext4]
   do_vfs_ioctl+0x4b8/0xbc0
   __arm64_sys_ioctl+0x8c/0x120
   invoke_syscall+0x6c/0x100
   el0_svc_common.constprop.0+0x48/0xf0
   do_el0_svc+0x24/0x38
   el0_svc+0x38/0x120
   el0t_64_sync_handler+0x10c/0x138
   el0t_64_sync+0x198/0x1a0
  ---[ end trace 0000000000000000 ]---

Cc: stable@kernel.org
Fixes: facab4d9711e ("ext4: return hole from ext4_map_blocks()")
Reported-by: Qu Wenruo &lt;wqu@suse.com&gt;
Closes: https://lore.kernel.org/linux-ext4/9b650a52-9672-4604-a765-bb6be55d1e4a@gmx.com/
Tested-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Link: https://patch.msgid.link/20250811064532.1788289-1-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: don't try to clear the orphan_present feature block device is r/o</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2025-08-07T13:35:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c5e104a91e7b6fa12c1dc2d8bf84abb7ef9b89ad'/>
<id>urn:sha1:c5e104a91e7b6fa12c1dc2d8bf84abb7ef9b89ad</id>
<content type='text'>
When the file system is frozen in preparation for taking an LVM
snapshot, the journal is checkpointed and if the orphan_file feature
is enabled, and the orphan file is empty, we clear the orphan_present
feature flag.  But if there are pending inodes that need to be removed
the orphan_present feature flag can't be cleared.

The problem comes if the block device is read-only.  In that case, we
can't process the orphan inode list, so it is skipped in
ext4_orphan_cleanup().  But then in ext4_mark_recovery_complete(),
this results in the ext4 error "Orphan file not empty on read-only fs"
firing and the file system mount is aborted.

Fix this by clearing the needs_recovery flag in the block device is
read-only.  We do this after the call to ext4_load_and_init-journal()
since there are some error checks need to be done in case the journal
needs to be replayed and the block device is read-only, or if the
block device containing the externa journal is read-only, etc.

Cc: stable@kernel.org
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1108271
Cc: stable@vger.kernel.org
Fixes: 02f310fcf47f ("ext4: Speedup ext4 orphan inode handling")
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix reserved gdt blocks handling in fsmap</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Ojaswin Mujoo</name>
<email>ojaswin@linux.ibm.com</email>
</author>
<published>2025-08-05T08:30:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ffbdd1f1165f1b2d6a94d1b1aabef57120deaf7'/>
<id>urn:sha1:3ffbdd1f1165f1b2d6a94d1b1aabef57120deaf7</id>
<content type='text'>
In some cases like small FSes with no meta_bg and where the resize
doesn't need extra gdt blocks as it can fit in the current one,
s_reserved_gdt_blocks is set as 0, which causes fsmap to emit a 0
length entry, which is incorrect.

  $ mkfs.ext4 -b 65536 -O bigalloc /dev/sda 5G
  $ mount /dev/sda /mnt/scratch
  $ xfs_io -c "fsmap -d" /mnt/scartch

        0: 253:48 [0..127]: static fs metadata 128
        1: 253:48 [128..255]: special 102:1 128
        2: 253:48 [256..255]: special 102:2 0     &lt;---- 0 len entry
        3: 253:48 [256..383]: special 102:3 128

Fix this by adding a check for this case.

Cc: stable@kernel.org
Fixes: 0c9ec4beecac ("ext4: support GETFSMAP ioctls")
Signed-off-by: Ojaswin Mujoo &lt;ojaswin@linux.ibm.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Link: https://patch.msgid.link/08781b796453a5770112aa96ad14c864fbf31935.1754377641.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix fsmap end of range reporting with bigalloc</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Ojaswin Mujoo</name>
<email>ojaswin@linux.ibm.com</email>
</author>
<published>2025-08-05T08:30:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bae76c035bf0852844151e68098c9b7cd63ef238'/>
<id>urn:sha1:bae76c035bf0852844151e68098c9b7cd63ef238</id>
<content type='text'>
With bigalloc enabled, the logic to report last extent has a bug since
we try to use cluster units instead of block units. This can cause an
issue where extra incorrect entries might be returned back to the
user. This was flagged by generic/365 with 64k bs and -O bigalloc.

** Details of issue **

The issue was noticed on 5G 64k blocksize FS with -O bigalloc which has
only 1 bg.

$ xfs_io -c "fsmap -d" /mnt/scratch

  0: 253:48 [0..127]: static fs metadata 128   /* sb */
  1: 253:48 [128..255]: special 102:1 128   /* gdt */
  3: 253:48 [256..383]: special 102:3 128   /* block bitmap */
  4: 253:48 [384..2303]: unknown 1920       /* flex bg empty space */
  5: 253:48 [2304..2431]: special 102:4 128   /* inode bitmap */
  6: 253:48 [2432..4351]: unknown 1920      /* flex bg empty space */
  7: 253:48 [4352..6911]: inodes 2560
  8: 253:48 [6912..538623]: unknown 531712
  9: 253:48 [538624..10485759]: free space 9947136

The issue can be seen with:

$ xfs_io -c "fsmap -d 0 3" /mnt/scratch

  0: 253:48 [0..127]: static fs metadata 128
  1: 253:48 [384..2047]: unknown 1664

Only the first entry was expected to be returned but we get 2. This is
because:

ext4_getfsmap_datadev()
  first_cluster, last_cluster = 0
  ...
  info-&gt;gfi_last = true;
  ext4_getfsmap_datadev_helper(sb, end_ag, last_cluster + 1, 0, info);
    fsb = C2B(1) = 16
    fslen = 0
    ...
    /* Merge in any relevant extents from the meta_list */
    list_for_each_entry_safe(p, tmp, &amp;info-&gt;gfi_meta_list, fmr_list) {
      ...
      // since fsb = 16, considers all metadata which starts before 16 blockno
      iter 1: error = ext4_getfsmap_helper(sb, info, p);  // p = sb (0,1), nop
        info-&gt;gfi_next_fsblk = 1
      iter 2: error = ext4_getfsmap_helper(sb, info, p);  // p = gdt (1,2), nop
        info-&gt;gfi_next_fsblk = 2
      iter 3: error = ext4_getfsmap_helper(sb, info, p);  // p = blk bitmap (2,3), nop
        info-&gt;gfi_next_fsblk = 3
      iter 4: error = ext4_getfsmap_helper(sb, info, p);  // p = ino bitmap (18,19)
        if (rec_blk &gt; info-&gt;gfi_next_fsblk) { // (18 &gt; 3)
          // emits an extra entry ** BUG **
        }
    }

Fix this by directly calling ext4_getfsmap_datadev() with a dummy
record that has fmr_physical set to (end_fsb + 1) instead of
last_cluster + 1. By using the block instead of cluster we get the
correct behavior.

Replacing ext4_getfsmap_datadev_helper() with ext4_getfsmap_helper()
is okay since the gfi_lastfree and metadata checks in
ext4_getfsmap_datadev_helper() are anyways redundant when we only want
to emit the last allocated block of the range, as we have already
taken care of emitting metadata and any last free blocks.

Cc: stable@kernel.org
Reported-by: Disha Goel &lt;disgoel@linux.ibm.com&gt;
Fixes: 4a622e4d477b ("ext4: fix FS_IOC_GETFSMAP handling")
Signed-off-by: Ojaswin Mujoo &lt;ojaswin@linux.ibm.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Link: https://patch.msgid.link/e7472c8535c9c5ec10f425f495366864ea12c9da.1754377641.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: remove redundant __GFP_NOWARN</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Qianfeng Rong</name>
<email>rongqianfeng@vivo.com</email>
</author>
<published>2025-08-03T10:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ba97589ed19210ff808929052696f5636139823'/>
<id>urn:sha1:4ba97589ed19210ff808929052696f5636139823</id>
<content type='text'>
GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
the redundant __GFP_NOWARN.

Signed-off-by: Qianfeng Rong &lt;rongqianfeng@vivo.com&gt;
Link: https://patch.msgid.link/20250803102243.623705-4-rongqianfeng@vivo.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix unused variable warning in ext4_init_new_dir</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2025-07-31T20:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59d8731c887bf2f5bb8406ace26cbb6f6b36d6cc'/>
<id>urn:sha1:59d8731c887bf2f5bb8406ace26cbb6f6b36d6cc</id>
<content type='text'>
Cc: stable@kernel.org
Fixes: 90f097b1403f ("ext4: refactor the inline directory conversion and...")
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: remove useless if check</title>
<updated>2025-08-13T03:15:05Z</updated>
<author>
<name>Antonio Quartulli</name>
<email>antonio@mandelbit.com</email>
</author>
<published>2025-07-21T20:09:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3fbaa74d999c16b5caeca779e6d7e6e6e7feed8'/>
<id>urn:sha1:f3fbaa74d999c16b5caeca779e6d7e6e6e7feed8</id>
<content type='text'>
This if branch is only jumping to 'out' which
is defined just after the branch itself.
Hence this is if-check is a no-op and can be removed.

Address-Coverity-ID: 1647981 ("Incorrect expression  (IDENTICAL_BRANCHES)")
Signed-off-by: Antonio Quartulli &lt;antonio@mandelbit.com&gt;
Link: https://patch.msgid.link/20250721200902.1071-1-antonio@mandelbit.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
