]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'vfs-7.0-rc1.misc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Feb 2026 21:00:36 +0000 (13:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Feb 2026 21:00:36 +0000 (13:00 -0800)
Pull more misc vfs updates from Christian Brauner:
 "Features:

   - Optimize close_range() from O(range size) to O(active FDs) by using
     find_next_bit() on the open_fds bitmap instead of linearly scanning
     the entire requested range. This is a significant improvement for
     large-range close operations on sparse file descriptor tables.

   - Add FS_XFLAG_VERITY file attribute for fs-verity files, retrievable
     via FS_IOC_FSGETXATTR and file_getattr(). The flag is read-only.
     Add tracepoints for fs-verity enable and verify operations,
     replacing the previously removed debug printk's.

   - Prevent nfsd from exporting special kernel filesystems like pidfs
     and nsfs. These filesystems have custom ->open() and ->permission()
     export methods that are designed for open_by_handle_at(2) only and
     are incompatible with nfsd. Update the exportfs documentation
     accordingly.

  Fixes:

   - Fix KMSAN uninit-value in ovl_fill_real() where strcmp() was used
     on a non-null-terminated decrypted directory entry name from
     fscrypt. This triggered on encrypted lower layers when the
     decrypted name buffer contained uninitialized tail data.

     The fix also adds VFS-level name_is_dot(), name_is_dotdot(), and
     name_is_dot_dotdot() helpers, replacing various open-coded "." and
     ".." checks across the tree.

   - Fix read-only fsflags not being reset together with xflags in
     vfs_fileattr_set(). Currently harmless since no read-only xflags
     overlap with flags, but this would cause inconsistencies for any
     future shared read-only flag

   - Return -EREMOTE instead of -ESRCH from PIDFD_GET_INFO when the
     target process is in a different pid namespace. This lets userspace
     distinguish "process exited" from "process in another namespace",
     matching glibc's pidfd_getpid() behavior

  Cleanups:

   - Use C-string literals in the Rust seq_file bindings, replacing the
     kernel::c_str!() macro (available since Rust 1.77)

   - Fix typo in d_walk_ret enum comment, add porting notes for the
     readlink_copy() calling convention change"

* tag 'vfs-7.0-rc1.misc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  fs: add porting notes about readlink_copy()
  pidfs: return -EREMOTE when PIDFD_GET_INFO is called on another ns
  nfsd: do not allow exporting of special kernel filesystems
  exportfs: clarify the documentation of open()/permission() expotrfs ops
  fsverity: add tracepoints
  fs: add FS_XFLAG_VERITY for fs-verity files
  rust: seq_file: replace `kernel::c_str!` with C-Strings
  fs: dcache: fix typo in enum d_walk_ret comment
  ovl: use name_is_dot* helpers in readdir code
  fs: add helpers name_is_dot{,dot,_dotdot}
  ovl: Fix uninit-value in ovl_fill_real
  fs: reset read-only fsflags together with xflags
  fs/file: optimize close_range() complexity from O(N) to O(Sparse)

14 files changed:
1  2 
Documentation/filesystems/porting.rst
MAINTAINERS
fs/dcache.c
fs/f2fs/dir.c
fs/file_attr.c
fs/namei.c
fs/nfsd/export.c
fs/overlayfs/readdir.c
fs/pidfs.c
fs/smb/server/vfs.c
fs/verity/enable.c
fs/verity/fsverity_private.h
fs/verity/verify.c
include/linux/fs.h

index 79e2c300828915fa2b8a86907ad7b039ef1ec98b,bd4128ccbb67e985b218de9e434a8107cb0e13ef..52ff1d19405beb8add035c9b305ec8a18e134b7a
@@@ -1336,18 -1339,8 +1336,28 @@@ in-tree filesystems have done)
  
  **mandatory**
  
 +The ->setlease() file_operation must now be explicitly set in order to provide
 +support for leases. When set to NULL, the kernel will now return -EINVAL to
 +attempts to set a lease. Filesystems that wish to use the kernel-internal lease
 +implementation should set it to generic_setlease().
 +
 +---
 +
 +**mandatory**
 +
 +fs/namei.c primitives that consume filesystem references (do_renameat2(),
 +do_linkat(), do_symlinkat(), do_mkdirat(), do_mknodat(), do_unlinkat()
 +and do_rmdir()) are gone; they are replaced with non-consuming analogues
 +(filename_renameat2(), etc.)
 +Callers are adjusted - responsibility for dropping the filenames belongs
 +to them now.
++
++---
++
++**mandatory**
++
+ readlink_copy() now requires link length as the 4th argument. Said length needs
+ to match what strlen() would return if it was ran on the string.
+ However, if the string is freely accessible for the duration of inode's
+ lifetime, consider using inode_set_cached_link() instead.
diff --cc MAINTAINERS
Simple merge
diff --cc fs/dcache.c
Simple merge
diff --cc fs/f2fs/dir.c
Simple merge
diff --cc fs/file_attr.c
Simple merge
diff --cc fs/namei.c
Simple merge
Simple merge
Simple merge
diff --cc fs/pidfs.c
Simple merge
Simple merge
index c9448074cce17d870d61a8036f213bd8715a6656,8718d943b428283d495eddb909be6991bc70bd6b..42dfed1ce0ce66f1b3b28e858fd49f66f9595892
@@@ -265,26 -266,11 +267,28 @@@ static int enable_verity(struct file *f
                goto rollback;
        }
  
+       trace_fsverity_tree_done(inode, vi, &params);
 +      /*
 +       * Add the fsverity_info into the hash table before finishing the
 +       * initialization so that we don't have to undo the enabling when memory
 +       * allocation for the hash table fails.  This is safe because looking up
 +       * the fsverity_info always first checks the S_VERITY flag on the inode,
 +       * which will only be set at the very end of the ->end_enable_verity
 +       * method.
 +       */
 +      err = fsverity_set_info(vi);
 +      if (err) {
 +              fsverity_free_info(vi);
 +              goto rollback;
 +      }
 +
        /*
         * Tell the filesystem to finish enabling verity on the file.
 -       * Serialized with ->begin_enable_verity() by the inode lock.
 +       * Serialized with ->begin_enable_verity() by the inode lock.  The file
 +       * system needs to set the S_VERITY flag on the inode at the very end of
 +       * the method, at which point the fsverity information can be accessed
 +       * by other threads.
         */
        inode_lock(inode);
        err = vops->end_enable_verity(filp, desc, desc_size, params.tree_size);
Simple merge
Simple merge
Simple merge