linux/fs/nilfs2
Linus Torvalds d28fb91dd8 nilfs2 updates for v7.4
- nilfs2: validate directory position after llseek in readdir
 - nilfs2: reject non-regular inodes in dsync recovery
 - nilfs2: fix link count underflow when removing corrupted directory
 - nilfs2: simplify nilfs_mdt_writeback()
 - nilfs2: ignore non-fatal signals during synchronous log write wait
 - nilfs2: clear dirty flag on bdev buffers on log write failure
 - nilfs2: fix deadlock between nilfs_evict_inode() and find_inode()
 - nilfs2: fix checkpoint root lifetime on sysfs errors
 - nilfs2: switch O_DIRECT to iomap based operations
 - nilfs2: add iomap operations for direct I/O
 - nilfs2: validate file block counts during recovery
 - nilfs2: force clear dirty state when restoring from the shadow map
 - nilfs2: validate segment number in nilfs_sufile_get_suinfo()
 - nilfs2: fix typos in comments
 - nilfs2: remove '#if 0' code blocks
 - nilfs2: strengthen consistency checks in nilfs_direct_propagate()
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQT4wVoLCG92poNnMFAhI4xTh21NnQUCatKPawAKCRAhI4xTh21N
 nSaCAP4iCRMt3BFD5VKUw88HOroKAVJ9OwLFPYNyJS76Xh0ZFgD/Qw/jwdO+Ui1b
 tgxQ62Gc0V7gwpeASgTG5Wq2c6XDSgI=
 =5i44
 -----END PGP SIGNATURE-----

Merge tag 'nilfs2-v7.4-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/vdubeyko/nilfs2

Pull nilfs2 updates from Viacheslav Dubeyko:
 "Fix issues in nilfs_sufile_get_suinfo(), nilfs_scan_dsync_log(), and
  nilfs_find_or_create_root() (Aldo Ariel Panzardo):
   - If the requested segment number is greater than the total number of
     segments, the function may process segment numbers outside the
     filesystem.
   - nilfs_scan_dsync_log() trusts the block counts in each on-disk file
     information entry. If fi_ndatablk is greater than fi_nblocks, the
     data block loop can consume excessive summary entries and the later
     subtraction used to derive the number of node blocks underflows.
   - nilfs_find_or_create_root() links a new checkpoint root into the
     checkpoint tree and drops ns_cptree_lock before creating the root's
     sysfs group. If nilfs_sysfs_create_snapshot_group() then fails, the
     root is freed while it is still reachable from ns_cptree, so a
     concurrent nilfs_lookup_root() can dereference freed memory.

  Fix typos in comments, reported by scripts/checkpatch.pl using the
  misspelling list in scripts/spelling.txt (Hemanth Selam)

  Fix issues in nilfs_recover_dsync_blocks() and nilfs_readdir() (Jake
  Labelle):
   - During roll-forward recovery, nilfs_recover_dsync_blocks() obtains
     the inode designated by fi_ino of a dsync log without checking its
     type. Regular files, directories, and symlinks are the only inode
     types with data blocks to recover; reject anything else before
     touching its block mapping.
   - nilfs_readdir() uses ctx->pos, which userspace can set to an
     arbitrary value via llseek, as an offset into the directory folio
     and parses whatever bytes sit there as a directory entry. Snap
     unaligned positions onto a valid entry boundary by walking the
     rec_len chain from the chunk start before parsing.

  Fix issue in logic of clearing the dirty folios. When garbage
  collection fails, nilfs2 rolls the DAT metadata file's page cache back
  to a shadow copy taken before GC started. nilfs_clear_dirty_pages()
  drops the dirty state of the folios in the DAT cache, then
  nilfs_copy_back_pages() overwrites them with the saved contents and
  warns if one is still dirty. Add a force flag to
  nilfs_clear_dirty_pages() and nilfs_clear_folio_dirty() that skips the
  busy buffer check, and set it in the two calls from
  nilfs_mdt_restore_from_shadow_map() (Jiaming Zhang)

  Remove dead code and comment code sections in nilfs_new_inode(),
  nilfs_read_inode_common(), and nilfs_setup_super() (Joshua Crofts)

  Multiple fixes (Ryusuke Konishi):
   - While the recent out-of-bounds memory access issue in
     nilfs_direct_propagate() has already been fixed, adds extra checks
     to catch and gracefully handle similar potential bugs.
   - Fix syzbot reported deadlock between nilfs_evict_inode() and
     find_inode() by removing the synchronous log writer trigger from
     nilfs_evict_inode().
   - Fix an omitted clear of the dirty flag on backing device buffers,
     which could cause an abnormal buffer state and potential block
     overwriting data corruption.
   - Improve stability by preventing errors caused by user interrupts
     while waiting for log writes, which are triggered by synchronous
     write flags following operations such as rename().
   - Refactor the metadata file writeback callback function,
     restructuring an inefficient legacy function organization rooted in
     the era of aops->writepage() to align with aops->writepages().
   - Fix a link count underflow during rmdir on a directory with a
     corrupted link count (an issue recently reported by syzbot).

  Eliminate blockdev_direct_IO() from nilfs2 entirely. Add iomap.h
  with declaration of iomap operations and iomap.c with implementation
  of nilfs_iomap_begin(). The nilfs_direct_IO() and the .direct_IO
  callback on nilfs_aops are removed. The nilfs_file_read_iter()
  dispatches O_DIRECT reads to iomap_dio_rw() using nilfs_iomap_ops.
  Everything else still goes through generic_file_read_iter()
  (Viacheslav Dubeyko)"

* tag 'nilfs2-v7.4-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/vdubeyko/nilfs2:
  nilfs2: validate directory position after llseek in readdir
  nilfs2: reject non-regular inodes in dsync recovery
  nilfs2: fix link count underflow when removing corrupted directory
  nilfs2: simplify nilfs_mdt_writeback()
  nilfs2: ignore non-fatal signals during synchronous log write wait
  nilfs2: clear dirty flag on bdev buffers on log write failure
  nilfs2: fix deadlock between nilfs_evict_inode() and find_inode()
  nilfs2: fix checkpoint root lifetime on sysfs errors
  nilfs2: switch O_DIRECT to iomap based operations
  nilfs2: add iomap operations for direct I/O
  nilfs2: validate file block counts during recovery
  nilfs2: force clear dirty state when restoring from the shadow map
  nilfs2: validate segment number in nilfs_sufile_get_suinfo()
  nilfs2: fix typos in comments
  nilfs2: remove '#if 0' code blocks
  nilfs2: strengthen consistency checks in nilfs_direct_propagate()
2026-10-20 15:59:26 -10:00
..
alloc.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
alloc.h
bmap.c nilfs2: fix slab-out-of-bounds in nilfs_direct_propagate after truncation 2026-07-28 16:33:03 -07:00
bmap.h nilfs2: fix slab-out-of-bounds in nilfs_direct_propagate after truncation 2026-07-28 16:33:03 -07:00
btnode.c nilfs2: Convert nilfs_btnode_submit_block to bh_submit() 2026-06-04 10:28:09 +02:00
btnode.h
btree.c nilfs2: enhance btree node keys check 2026-08-10 16:02:25 -07:00
btree.h
cpfile.c nilfs2: handle corrupted checkpoint count gracefully during deletion 2026-07-07 11:13:58 -07:00
cpfile.h
dat.c nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map 2026-03-30 19:57:15 -07:00
dat.h
dir.c nilfs2: validate directory position after llseek in readdir 2026-10-08 09:39:43 -07:00
direct.c nilfs2: strengthen consistency checks in nilfs_direct_propagate() 2026-09-03 13:22:32 -07:00
direct.h
export.h
file.c nilfs2: switch O_DIRECT to iomap based operations 2026-09-21 11:40:24 -07:00
gcinode.c nilfs2: Convert nilfs_gccache_submit_read_data to bh_submit() 2026-06-04 10:28:10 +02:00
ifile.c nilfs2: standardize the inode number type to u64 2026-08-10 16:06:23 -07:00
ifile.h nilfs2: standardize the inode number type to u64 2026-08-10 16:06:23 -07:00
inode.c nilfs2 updates for v7.4 2026-10-20 15:59:26 -10:00
ioctl.c nilfs2 updates for v7.4 2026-10-20 15:59:26 -10:00
iomap.c nilfs2: add iomap operations for direct I/O 2026-09-21 11:40:24 -07:00
iomap.h nilfs2: add iomap operations for direct I/O 2026-09-21 11:40:24 -07:00
Kconfig nilfs2: switch O_DIRECT to iomap based operations 2026-09-21 11:40:24 -07:00
Makefile nilfs2: add iomap operations for direct I/O 2026-09-21 11:40:24 -07:00
mdt.c nilfs2: simplify nilfs_mdt_writeback() 2026-10-05 10:12:54 -07:00
mdt.h
namei.c nilfs2 updates for v7.4 2026-10-20 15:59:26 -10:00
nilfs.h fs: port ->setattr() to pass const mnt_idmap 2026-09-23 09:19:51 +02:00
page.c nilfs2: force clear dirty state when restoring from the shadow map 2026-09-17 12:42:43 -07:00
page.h nilfs2: force clear dirty state when restoring from the shadow map 2026-09-17 12:42:43 -07:00
recovery.c nilfs2: reject non-regular inodes in dsync recovery 2026-10-08 09:39:43 -07:00
segbuf.c
segbuf.h
segment.c nilfs2: ignore non-fatal signals during synchronous log write wait 2026-09-29 16:35:33 -07:00
segment.h nilfs2: remove wbc->for_reclaim handling 2025-05-21 10:48:23 -07:00
sufile.c nilfs2: validate segment number in nilfs_sufile_get_suinfo() 2026-09-17 12:33:27 -07:00
sufile.h nilfs2: suppress false positive WARN_ONs for sufile after an FS error 2026-08-07 10:12:39 -07:00
super.c nilfs2: fix typos in comments 2026-09-07 10:15:38 -07:00
sysfs.c nilfs2: fix checkpoint root lifetime on sysfs errors 2026-09-22 14:49:30 -07:00
sysfs.h nilfs2: fix CFI failure when accessing /sys/fs/nilfs2/features/* 2025-09-13 13:05:38 -07:00
the_nilfs.c nilfs2: fix checkpoint root lifetime on sysfs errors 2026-09-22 14:49:30 -07:00
the_nilfs.h