aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
3 hoursMerge tag 'sched-core-2026-10-18' of ↵Linus Torvalds1-5/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "Kconfig updates: - Simplify PREEMPT_DYNAMIC (Mark Rutland) Fair scheduler updates: - Remove redundant RUN_TO_PARITY check (Elif Topuz) - Declare augmented callbacks per field, fix rb_add_augmented_cached() descent (Yiwei Lin, Peter Zijlstra) - Restart fair hrtick after same-task repicks (Shubhang Kaushik) - Improve the scheduling latency of short slice tasks (Vincent Guittot) Deadline/RT scheduler updates: - Check start_dl_timer expiry with ktime_before() (Liang Hao) - irq_work: CPU-hotplug improvements on PREEMPT_RT (Sebastian Andrzej Siewior) Energy-aware scheduling updates: - Implement the steal_governor, introduce preferred CPUs and steal-driven vCPU backoff (Shrikanth Hegde) Multi-processor load-balancing updates: - Enable preferred SMT siblings on NVIDIA Olympus (Andrea Righi) - Randomize equally shallow idle CPU picks (Christian Loehle) - Remove redundant core_sched_seq (Hui Su) Cache-aware scheduling updates: - Avoid publishing partial LLC utilization (Jemmy Wong) NUMA-balancing updates: - Reset NUMA fault locality after scan period update (Eric Kim) Proxy execution updates: - Ongoing work to implement sleeping owner handling for proxy execution (John Stultz, Vasily Gorbik) - Preparatory steps to make sched_ext compatible with proxy execution (Andrea Righi) Scheduler infrastructure updates & fixes: - Remove the RCU wait from PSI trigger destruction (Shakeel Butt) - Avoid modifying wait-entry on failed priority registration (Hui Su) - Use the new static key API for sched_feat (Hongyan Xia) - Convert paravirt_steal to new static key APIs (Hongyan Xia) - cputime: Don't account idle time twice after dyntick-idle (Stian Halseth) Scheduler debugging updates: - Set TIF_NEED_RESCHED before calling __trace_set_need_resched() (Sechang Lim) - Fix context analysis errors in non-preferred CPU push (Shrikanth Hegde) Misc cleanups and fixes by Christian Loehle, Shubhang Kaushik, Thomas Huth and Vladimir Zapolskiy" * tag 'sched-core-2026-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits) sched: Replace nr_iowait_cpu() with a bool accessor Revert "sched/fair: Remove dead code on enqueue_task_fair()" sched/cache: Avoid publishing partial LLC utilization sched/cputime: Don't account idle time twice after dyntick-idle sched/psi: Remove the RCU wait from trigger destruction sched/eevdf: Remove redundant RUN_TO_PARITY check sched/wait: Avoid modifying entry on failed priority registration rbtree_test: Use rb_add_augmented_cached() for the cached augmented test rbtree: Update augmented data on the way down in rb_add_augmented_cached() rbtree: Declare augmented callbacks per field with RB_AUG() rbtree_test: Use rb_add() and rb_add_cached() for the basic tests smpboot: Don't park the thread if work is pending irq_work: Flush lazy work CPU down on PREEMPT_RT irq_work: Update a comment regarding CPU hotplug invocation sched/topology: Add asymmetric SMT packing override sched/fair: Honor asymmetric SMT priority in idle selection sched: Set TIF_NEED_RESCHED before calling __trace_set_need_resched() sched/core: Fix context analysis errors in non-preferred CPU push virt/steal_governor: Enable the driver virt/steal_governor: Implement steal_governor policy loop ...
5 hoursMerge tag 'x86_cache_for_v7.4_rc1' of ↵Linus Torvalds4-17/+10
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 resource control updates from Borislav Petkov: - Push down into arch code the rounding of bandwidth control user values due to the different ways ARM and x86 report MBA - Fix task reporting for the default group for systems which support only bandwidth monitoring, aka Haswell vintage computing - The usual fixlets and improvements * tag 'x86_cache_for_v7.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: fs/resctrl: Ensure default group reports tasks on monitor-only systems x86,fs/resctrl: Add event group descriptions for Intel Diamond Rapids x86/resctrl: Update documented unit for the "activity" event fs/resctrl: Simplify pseudo_lock_measure_trigger() fs/resctrl: Avoid extra call to strlen() in schemata_list_add() fs/resctrl: Factor MBA parse-time conversion to be per-arch arm_mpam: resctrl: Add pass-through resctrl_arch_preconvert_bw() x86,fs/resctrl: Add resctrl_arch_preconvert_bw()
18 hoursMerge tag 'vfs-7.4-rc1.sync_close' of ↵Linus Torvalds7-115/+147
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull file closing updates from Christian Brauner: "This makes closing files synchronous for close_range(), exec and exit. Since fput() was switched to task work every final __fput() of an exiting task is queued on task work and run from exit_task_work(). exec and close_range() do the same. For a task with a large descriptor table that is a cmpxchg() and a TIF_NOTIFY_RESUME test-and-set per file plus a list entry for any later task_work_cancel() to search under pi_lock, and then a second pass over every struct file that isn't cache hot anymore by then. Oleg and Neil have pointed this out over the years. close_files(), close_range() and close-on-exec now flush and put each file inline the way close(2) does. Kernel threads aren't affected. They share init_files which init_task pins forever so their exit_files() never drops the last reference, and their fput() keeps punting to a workqueue. The one place that could put a table from a kthread context, a failing copy_process(), can't hold the last reference while the source table is alive. On a 64 vCPU KVM guest tearing down 4096, 65536 and 1M descriptors scattered at random positions in the table: 4096 fds 65536 fds 1M fds exit 1045 -> 895 us 18.9 -> 14.9 ms 429 -> 306 ms execve, close-on-exec 1393 -> 1190 us 21.4 -> 16.9 ms 471 -> 325 ms close_range() 1179 -> 988 us 21.9 -> 17.4 ms 484 -> 337 ms So that is 16-21% or 40-150 ns per closed file, largest at 1M descriptors. With eight processes tearing down 65536 descriptors each at once it stays at 16-21% because the second pass over 16 MB of struct file is what gets expensive when CPUs compete for the cache. With 32 or 64 processes both kernels are bound by pushing millions of files through slab and rcu and the difference shrinks to 4-8%. Files whose own release dominates gain less, 13% for eventfds, 11% for pipes, 6% for AF_UNIX sockets. close(2) is untouched and will-it-scale is within 2%. The spufs coredump support is removed. It was the only reason do_coredump() unshared the descriptor table. gdb dropped Cell debugging in 9.1 and binutils in 2.34, the Cell blades are gone and nothing on the PlayStation 3 produces or reads these notes. With that unshare_files() goes away, exec installs its private table through the new switch_files_struct() and the coredump startup completion becomes a plain thread count waited on with the new wait_var_event_state(). Three fixes for the synchronous close are included. A failed fork released its files under scx_fork_rwsem and deadlocked against the bpf link's release. A session leader's exit released its tty before disassociate_ctty() ran and the foreground job lost its SIGHUP, so the tty is hung up before the files are closed now. And descriptor tables are walked from the highest descriptor down which restores the order the deferred puts had and keeps a few long-standing release ordering bugs from deadlocking exit" * tag 'vfs-7.4-rc1.sync_close' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: close files from the highest descriptor down coredump: factor out coredump_wait_inactive() exit: hang up the tty before closing the files fork: release the files of a failed fork after sched_cancel_fork() coredump: replace the startup completion with a thread count sched: add wait_var_event_state() coredump: drop core_state->dumper fs: make close_cloexec_files() synchronous fs: rename do_close_on_exec() to close_cloexec_files() fs: make close_range() synchronous fs: make close_files() synchronous fs: add filp_close_sync() fs: remove unshare_files() fs: move unshare_fd() to fs/file.c fs: add switch_files_struct() coredump: stop unsharing the file descriptor table fs: don't open-code file_close_fd() in close_fd() powerpc: remove coredump support
18 hoursMerge tag 'vfs-7.4-rc1.shared.super' of ↵Linus Torvalds1-4/+15
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull superblock updates from Christian Brauner: "This renames vfs_get_super() to get_tree_super() and exports it so a filesystem that needs its own superblock matching policy can reuse it instead of open-coding sget_fc() plus fill_super(). erofs uses it to share a superblock between file-backed mounts" * tag 'vfs-7.4-rc1.shared.super' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: rename vfs_get_super() to get_tree_super() and export it
19 hoursMerge tag 'vfs-7.4-rc1.shared.net-next.pidfd' of ↵Linus Torvalds2-11/+38
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull pidfd updates from Christian Brauner: "This adds thread specific pidfds to af_unix sockets. SO_PASSPIDFD and SO_PEERPIDFD hand out a pidfd for the thread-group leader. A coredump server on the coredump socket can't get a handle on the thread that took the signal and is writing the dump, and anything doing per-thread authentication has the same problem. The sending and the connecting thread are recorded in addition to the thread-group leader and sk_peer_pid becomes an array indexed by pid type. SO_PASSPIDFD_THREAD works like SO_PASSPIDFD but delivers an SCM_PIDFD_THREAD cmsg for the sending thread. Both options are independent so a receiver can ask for both. On SOCK_STREAM sockets recvmsg() only stops merging data at a thread boundary when the receiver asked for a thread pidfd. SO_PEERPIDFD_THREAD returns a pidfd for the thread that called connect(), listen() or socketpair(). pidfs records the coredump on the dumping thread's struct pid too so its pidfd reports it like the leader's does. Selftests for af_unix and the coredump socket are included" * tag 'vfs-7.4-rc1.shared.net-next.pidfd' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: selftests/coredump: check the dumping thread's pidfd pidfs: record the coredump on the dumping thread's pid too selftests/net: SO_PEERPIDFD_THREAD net: add SO_PEERPIDFD_THREAD to get a thread-specific pidfd af_unix: record the pid of the connecting thread net: turn sk_peer_pid into an array indexed by pid type selftests/net: SO_PASSPIDFD_THREAD net: add SO_PASSPIDFD_THREAD to get a thread-specific SCM_PIDFD af_unix: record the pid of the sending thread pid: add helpers to operate on a struct pid array
19 hoursMerge tag 'vfs-7.4-rc1.netfs' of ↵Linus Torvalds43-724/+896
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull netfs updates from Christian Brauner: "This contains the netfs and cachefiles changes for this cycle from David. Cachefiles learns to cache the most common class of files properly, files that are created or truncated, written once sequentially and closed. So far it relied on the backing filesystem's idea of what is stored and asked with SEEK_DATA and SEEK_HOLE before every read it prepared, two seeks per read, and the backing filesystem is free to insert or remove runs of zeros which produces false positives and false negatives. The object type in the state xattr is now actually set to CACHEFILES_CONTENT_{SINGLE,ALL,BACKFS_MAP} instead of zero. For files written contiguously the type is ALL, the backing file's i_size tracks how much is cached and the object size lives in the xattr, and reads skip the seeks entirely. Netfslib queries the cache occupancy through a new ->query_occupancy() method that returns up to two extents at once, ->prepare_read() only limits the size of a cache read anymore and a new ->collect_write() lets the cache update its metadata once a contiguous run of writes completes. The state xattr is preset when the tmpfile is created so ENOSPC from setxattr can't scrap a fully written cache file. Two fixes for this followed, one for resize handling where the cache's idea of the size can be stale and one for an unset error that hung a request on a failed cache write. Preparatory work converts file positions that can't be negative to uoff_t, removes the writethrough code whose locking looked like it could deadlock with ceph snapshots, makes the deprecated PG_private_2 support opt-in so mm can get its page bit back, adds helpers for the NETFS_RREQ_ALL_QUEUED barriers and adds the cache object id to the read and write tracepoints. Plus an unused header removal and two documentation fixes" * tag 'vfs-7.4-rc1.netfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fscache, cachefiles: Fix resize handling cachefiles: Fix unset error when calling netfs_prepare_write_failed() netfs: remove unused fscache_internal.h header cachefiles: Preset the state xattr when creating a new file cachefiles: Don't rely on backing fs storage map for most use cases netfs: Document the remote size member and its accessors cachefiles: Add a tracepoint to log insufficient space errors netfs, cachefiles: Add a couple of traces for write failure cachefiles: Clean up cachefiles_do_prepare_read() netfs: Set subrequest->source at alloc before trace emission netfs: Add some functions to wrap the all-queued handling netfs: Make deprecated PG_private_2 support opt-in netfs: Add the cache object ID to netfs_read/write tracepoints netfs: trace: Rejig a couple of the tracepoints cachefiles: Fix path of the "debug" module parameter in help paragraph netfs: trace: Change the "clear" folio traces to "endwb" netfs: Remove the writethrough code netfs: Use uoff_t instead of unsigned long long and loff_t
19 hoursMerge tag 'vfs-7.4-rc1.mount' of ↵Linus Torvalds1-2/+14
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull mount updates from Christian Brauner: "This adds OPEN_TREE_DROP_MNTNS_MOUNTS. crun started using OPEN_TREE_NAMESPACE to set up the container's mount namespace and open_tree(OPEN_TREE_CLONE) for the sources of its bind mounts. That fails on any host with a mount namespace pinned below such a source. The recursive clone picks the pinned namespace up and move_mount() refuses to attach the tree with ELOOP. Only a younger mount namespace may ever be bound into an older one or mount namespace references could form a loop. A namespace created with OPEN_TREE_NAMESPACE is younger than everything else on the system so from inside it every pinned namespace is older. By the time this fails setns() has run and the host tree is out of reach, so the runtime has to predict the situation beforehand and lose the optimization. snapd pins mount namespaces under /run/snapd/ns so on Ubuntu that is any container bind mounting the host root. Every other path crossing a mount namespace boundary already leaves these mounts behind, copy_mnt_ns() and create_new_namespace() both do. Only get_detached_copy() asks for them. The new flag lets a caller get a clone without them. It stays opt-in because open_tree(OPEN_TREE_CLONE) plus move_mount() is mount --rbind through a file descriptor and dropping them by default would silently lose /run/snapd/ns/*.mnt on a live system. It requires AT_RECURSIVE, is a no-op with OPEN_TREE_NAMESPACE and skips locked nsfs mounts the way copy_mnt_ns() does, so nothing new is exposed. Selftests are included" * tag 'vfs-7.4-rc1.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: selftests/filesystems: test OPEN_TREE_DROP_MNTNS_MOUNTS mount: add OPEN_TREE_DROP_MNTNS_MOUNTS
20 hoursMerge tag 'vfs-7.4-rc1.misc' of ↵Linus Torvalds19-103/+178
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull misc vfs updates from Christian Brauner: "Fixes: - aio: a keyed poll completion on an epoll instance could recurse into the same epoll waitqueue lock when the result eventfd is watched by that very instance. An unprivileged process could make a CPU spin on the recursive lock. eventfd-backed poll completions are always deferred now. - fsnotify_inoderemove() is only called once the inode is really dead, no nlink and no aliases, and open_by_handle_at() can't add an alias to a dead inode anymore. The race could crash fsnotify or lose inode mark notifications. - devtmpfs: the conversion of the public instance to ->get_tree() broke reconfiguring the shared superblock's options on later mounts which made the boot time defaults permanent. A reconfigure context is kept in fc->fs_private so the parse ops can forward options to the underlying filesystem. - ufs truncated the 64-bit directory size to an unsigned int in ufs_last_byte(). A crafted image with a 4 GiB directory produced an out-of-folio read in ufs_find_entry() and, with CONFIG_UFS_FS_WRITE, a write into an adjacent page. - devpts rejects max=0 instead of silently lifting the per-instance pty limit. The value wrapped into ida_alloc_max() and became unlimited. - fs_pin publishes pins with the rcu list helpers so the kill paths reading the lists under rcu see the initialization. - dentry_kill() reports a Tasks-RCU quiescent state. Its cond_resched() is the only reschedule point on the dentry teardown path and cond_resched() isn't a quiescent state for Tasks-RCU, so Meta kept seeing rcu_tasks stalls in btrfs subvolume deletion. - writeback sizes foreign flushes by the target wb's dirty pages instead of the memcg-wide count which over or undersized a single bdi flush. - nfsd READ emitted two fsnotify access events on the iterator path since vfs_iocb_iter_read() already sends one. A READ on a krb5i or krb5p mount showed up twice in inotify. - pipe and splice pass a poll key when waking readers and writers so epoll, poll() and select() waiters only wake for the event they asked for. - the iso8859-14 Unicode to charset tables had page01 duplicated as page1e so 29 code points mapped to the wrong bytes and 22 that aren't in the charset were accepted. - orangefs doesn't wait for an unmount service operation that never returns on system shutdown and uses ssize_t for strscpy() errors. - __register_chrdev() checks the kobject_set_name() return value. - selftest fixes: the openat2 tests hardcoded O_LARGEFILE to 0x8000 which is O_NOFOLLOW on powerpc, resolve_test makes /tmp a mountpoint so RESOLVE_NO_XDEV has a boundary to trip over, file_stressor moves into its own directory with a 30 minute timeout, the kernfs listxattr test skips when SELinux exposes security.selinux, the namespaces active reference tests wait for the thread via a PIDFD_THREAD pidfd since pthread_join() returns before exit_nsproxy_namespaces(), the idmapped_tmpfile test chowns its directory into the mapped range, the clone3 CLONE_CLEAR_SIGHAND test adds CLONE_VM so it fails for the intended reason, the pidfd PPID error message prints the values it compares and fscontext_ns gets a .gitignore. Cleanups: - vmcore prints the release of the crashed kernel from the VMCOREINFO note so a kdump that dies before the dump lands still says which kernel it was for. - initramfs allocates hardlink hash entries with the validated cpio name length instead of PATH_MAX, which put every entry in kmalloc-8k. - the unused dax_layout_busy_page() is removed, dax_layout_busy_page_range() becomes static and dax_folio_init() drops a redundant list initialization. - vfs_empty_path() is removed, it has had no callers since getname_maybe_null(). - comment and documentation fixes in aio, bpf_fs_kfuncs, fs-writeback, inode, read_write, squashfs and the vfs.rst copy of struct file_system_type" * tag 'vfs-7.4-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (38 commits) selftests/filesystems: Fix idmapped_tmpfile layer dir ownership selftests/namespaces: Wait for thread exit via pidfd in active-ref tests writeback: size foreign flushes by target wb dirty pages initramfs: Reduce hardlink hash allocation sizes fs: remove unused vfs_empty_path() dcache: report a Tasks-RCU quiescent state in dentry_kill() vmcore: report the release of the crashed kernel splice: pass a poll key when waking pipe readers and writers pipe: pass a poll key when waking writers after a resize orangefs: use ssize_t instead of size_t for error codes... orangefs_super: don't wait on service operation on system shutdown. docs/vfs: Fix the struct file_system_type copy nls: fix the Unicode to charset tables of iso8859-14 selftests/filesystems/openat2: make /tmp a mountpoint inside private namespace selftests/filesystems/openat2: fix O_LARGEFILE definitions for non-arm64 architectures fs: fix misleading comments in read_write.c squashfs: fix inode number description in documentation fs: fix typos in comments fs/dax: Make dax_layout_busy_page_range() static fs/dax: Remove unused dax_layout_busy_page() ...
20 hoursMerge tag 'vfs-7.4-rc1.lookup' of ↵Linus Torvalds8-51/+248
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull path lookup updates from Christian Brauner: "This prepares for Neil's changes to directory locking. The goal is for the VFS to lock the dentry and not the parent directory and to push the i_rwsem parent locking down into the filesystems where it can be kept, removed or adjusted as each filesystem sees fit. The next step in that is to swap the lock order of d_alloc_parallel() and i_rwsem so code can wait on i_rwsem while holding an in-lookup dentry. Two things have to change before that can happen. Nobody may call d_alloc_parallel() while holding i_rwsem, and nobody may d_drop() a dentry while it is being worked on since that effectively unlocks an in-lookup dentry and lets another one be allocated too early. So d_splice_alias() learns to handle hashed dentries in addition to unhashed and in-lookup ones, which is what ->atomic_open() needs and removes the reason filesystems d_drop() first. d_alloc_trylock() is a non-blocking d_alloc_parallel() for the filesystems that prime the dcache from readdir, smb, nfs, fuse and ceph, where waiting for a concurrent lookup is pointless. d_duplicate() creates an in-lookup dentry with the name of an existing one for silly-rename and whiteouts. LOOKUP_SHARED tells ->lookup() how the parent is locked so it can drop and retake it. DCACHE_PAR_LOOKUP is tracked by lockdep now with a per filesystem type key, and overlayfs gets its own class since it stacks over itself. And a d_flags bit is reserved for filesystem private use. Also included is Mateusz's fix for the spurious dentry reference cycle on open. __legitimize_path() grabs a reference, do_dentry_open() grabs another and terminate_walk() drops the first. do_dentry_open() consumes the held reference now. Opening the same file read-only on a 20-core VM goes from 4,043,375 to 5,629,378 ops/s in will-it-scale" * tag 'vfs-7.4-rc1.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: VFS: d_duplicate: repair comments to avoid kernel-doc warnings ovl: provide private lockdep class for dentry->dep_map VFS: rename lookup_map to dep_map VFS: per-fs-type lockdep key for dentry in-lookup locking VFS: reserve a d_flags bit for fs-specific usage VFS: add lockdep monitoring of DCACHE_PAR_LOOKUP lock. VFS: Add LOOKUP_SHARED flag. VFS: add d_duplicate() VFS: introduce d_alloc_trylock() VFS: enhance d_splice_alias() to handle hashed dentries VFS: fix various typos in documentation for start_creating start_removing etc fs: avoid spurious dentry ref/unref cycle on open
20 hoursMerge tag 'vfs-7.4-rc1.kernfs' of ↵Linus Torvalds5-120/+219
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull kernfs updates from Christian Brauner: "This contains kernfs scalability work from Shakeel driven by what Meta sees in their fleet. kernfs_rwsem is per kernfs root, so sysfs and cgroupfs each have one for the whole machine, and every create, remove and rename takes it for writing. rwsems don't let readers steal the lock once a writer is queued, so one cgroup being created or a device being renamed parks the entire incoming reader stream in uninterruptible sleep. Daemons that poll cgroup files in a loop turn that into a convoy and the two that hurt most, oomd and below, are the ones that are supposed to relieve memory pressure and record what happened. kernfs_dop_revalidate() took kernfs_rwsem for read once per path component of every walk into a kernfs mount. Nothing it reads needs the semaphore. kn->active is an atomic_t, kn->__parent and kn->name are rcu pointers, kn->ns can be compared instead of dereferenced and the directory revision is a plain counter. The callback runs under rcu now. Readers walking cgroupfs and sysfs while another thread churns cgroups, renames netdevs and plugs devices went from 48,593,360 read acquisitions and 1,744,517 contentions to 1,280,280 and 429,846 on an 8-CPU VM and path walk throughput improved 35-53%. LOOKUP_RCU still returns ECHILD because kernfs_iop_permission() forces every walk out of rcu-walk anyway. That is left for later. kernfs_fop_readdir() held the semaphore across dir_emit(). dir_emit() copies to userspace and under memory pressure that fault goes to reclaim with the lock every create, remove and rename needs held for reading. Meta sees 120 second allocation stalls in filldir64() from below and systemd-oomd stuck behind it. The lock is dropped around dir_emit() now. Since the entry the listing stopped on can disappear in that window and two entries can share a hash, readdir resumes on the full (hash, ns, name) key and the fallback search lands after the missing entry instead of repeating or skipping one. The repeat was a pre-existing bug between two getdents(2) calls. Three more lock holds are shortened. kernfs_notify_workfn() no longer holds kernfs_rwsem across fsnotify() which allocates against the memcg of the watching cgroup that is already under pressure. The open node is allocated outside the hashed open file mutex, the most contended lock in kernfs on their fleet with 2.19M waiters over 29 days and a 77ms median hold. A new node is activated without dropping and retaking the write lock, lock_stat says 1200 -> 830 write acquisitions for five dummy netdevs, and kernfs_rename_ns() allocates the new name before and frees the old one after the lock so a rename can't enter reclaim or wait out a grace period with it held. Three standalone fixes come with selftests. Same-parent renames take kernfs_rename_lock too so kernfs_path_from_node() can't build a path that never existed. Decoding a file handle takes the semaphore so a decode racing rmdir() can't hash an inode after the removal's ilookup() pass and lose IN_DELETE_SELF. And kernfs_create_link() reads the target's uid and gid under kernfs_iattr_rwsem so a chown in between can't give the link an owner the target never had. The kernfs selftests grew from two xattr checks to coverage of dentry revalidation, rename, namespace tagging, file handles and readdir under churn" * tag 'vfs-7.4-rc1.kernfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: kernfs: free the old name outside kernfs_rwsem kernfs: allocate the new name outside kernfs_rwsem kernfs: activate a new node without dropping kernfs_rwsem selftests: cover readdir resuming at a removed entry kernfs: don't hold kernfs_rwsem across dir_emit() kernfs: resume readdir on the full entry key kernfs: don't repeat or skip an entry when readdir resumes kernfs: don't hold kernfs_rwsem across notification delivery kernfs: allocate the open node outside the open file mutex kernfs: fix up the unlocked attribute reads on the creation paths kernfs: don't lose IN_DELETE_SELF when decoding a file handle kernfs: take kernfs_rename_lock for same-parent renames too selftests: cover kernfs file handles and same-parent rename selftests: cover kernfs dentry revalidation kernfs: Remove kernfs_rwsem from dentry revalidation kernfs: Avoid namespace dereference in d_revalidate() kernfs: Prepare directory revisions for lockless reads kernfs: Use VFS lookup context in d_revalidate()
21 hoursMerge tag 'vfs-7.4-rc1.iomap' of ↵Linus Torvalds18-195/+425
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull iomap updates from Christian Brauner: "This contains the iomap changes for this cycle. The bulk is lazy bounce buffering for checksummed reads. XFS bounce buffers every direct read on a device that requires stable pages for checksumming so that userspace modifying the buffer while the read is in flight can't corrupt the data and fail the checksum. That burns DRAM bandwidth and CPU for copies that are almost never needed and, since the bounce buffer was a bio_vec, produced smaller and unaligned I/Os with 4k pages, i.e. 1 MB minus 4k. Now the read goes to the user buffer first and only a checksum failure allocates a bounce buffer and reads again. Integrity verification moves out of iomap into the filesystem so it can handle errors its own way, T10 PI handling for direct I/O moves into ->submit_io() to match buffered I/O, and a sysfs knob restores the old behaviour for the rare application that really does modify in-flight buffers. The block side gains bio_prepare_reissue(), exports fs_bio_integrity_{alloc,free}(), caps atomic writes by the PI buffer size and fixes an integer overflow in max_integrity_io_size() and a PI verification bug with an initial bvec offset. The old read side bounce buffering in the block layer is removed. This is a branch shared with the block tree and may also reach you through the block pull request. Three error handling regressions are fixed: - A failed ->writeback_submit() left wpc->wb_ctx pointing at an already completed ioend which was then submitted a second time and corrupted ip->i_ioend_list on XFS - iomap_fiemap() lost an iteration error when it flushed the pending extent and marked a truncated list as complete - A failed direct I/O bio lost its error when the sub-block tail zeroing succeeded. An XFS error tag to inject the writeback failure comes with it. iomap_dio_hole_iter() respects the block size alignment when iov_iter_zero() stops short at a page boundary, which btrfs with 8k blocks on 4k pages hit as an assertion since it disables page faults during direct I/O. The homegrown deferral of error completions to task context is replaced with bio_complete_in_task(). Plus an unused parameter, two typo fixes and a kernel-doc fix" * tag 'vfs-7.4-rc1.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (34 commits) fs/iomap: document ret parameter of iomap_iter_continue iomap: follow the alignment requirement for iomap_dio_hole_iter() iomap: don't lose a failed direct I/O bio's error when zeroing the tail iomap: don't lose a fiemap iteration error when emitting the last extent xfs: add an error tag to inject a ->writeback_submit() failure iomap: don't resubmit an ioend after ->writeback_submit() failed iomap: use bio_complete_in_task for buffered simple dio read failures iomap: use bio_complete_in_task for buffered write failures iomap: use bio_complete_in_task for buffered read failures block,iomap: remove the old read side bounce buffering support xfs: log a message at mount time when using integrity protection xfs: add error injection for lazy bounce buffering xfs: add support for lazy direct read bounce buffering iomap,xfs: move integrity verification to the file system xfs: use BIO_COMPLETE_IN_TASK for bounce buffered read I/Os iomap: better read bounce buffering support block,iomap: fix protection information verification with initial bvec offset xfs: move PI generation into xfs_submit_zoned_bio iomap,xfs: move T10 PI handling for direct I/O into ->submit_io iomap: add a IOMAP_IOEND_INTEGRITY flag ...
21 hoursMerge tag 'vfs-7.4-rc1.idmap' of ↵Linus Torvalds255-847/+856
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs idmap constification from Christian Brauner: "This makes struct mnt_idmap const throughout the tree. A mount's idmapping is immutable. The only thing modified after alloc_mnt_idmap() is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only reads from it. That is the same model struct cred uses and the idmapping is sensitive enough to deserve it. The conversion goes bottom up through the vfs{g,u}id and fs{g,u}id helpers, the privilege checks, acl, xattr and quota and then every inode operation that takes an idmap, so ->permission(), ->getattr(), ->setattr(), ->create(), ->mkdir(), ->mknod(), ->symlink(), ->rename(), ->tmpfile(), ->get_acl(), ->set_acl() and ->fileattr_set() with their implementations in every filesystem, plus the LSM hooks. struct vfsmount, struct mount_kattr and struct kstatmount store a const pointer and nop_mnt_idmap and invalid_mnt_idmap live in rodata, so anything that tries to modify them faults instead of silently corrupting the initial idmapping" * tag 'vfs-7.4-rc1.idmap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (27 commits) fs: make nop_mnt_idmap and invalid_mnt_idmap const fs: port mnt_idmap() and file_mnt_idmap() to const mnt_idmap fs: port vfs_*() helpers to const mnt_idmap fs: port ->setattr() to pass const mnt_idmap fs: port ->getattr() to pass const mnt_idmap fs: port ->create() to pass const mnt_idmap fs: port ->symlink() to pass const mnt_idmap fs: port ->mkdir() to pass const mnt_idmap fs: port ->rename() to pass const mnt_idmap fs: port ->mknod() to pass const mnt_idmap fs: port ->tmpfile() to pass const mnt_idmap fs: port ->get_acl() to pass const mnt_idmap fs: port ->set_acl() to pass const mnt_idmap fs: port ->fileattr_set() to pass const mnt_idmap fs: port xattr to const mnt_idmap fs: port ->permission() to pass const mnt_idmap fs: port acl to const mnt_idmap fs: port inode_init_owner() to const mnt_idmap fs: port inode_owner_or_capable() to const mnt_idmap fs: port privilege checking helpers to const mnt_idmap ...
22 hoursMerge tag 'vfs-7.4-rc1.file' of ↵Linus Torvalds9-20/+106
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull file table updates from Christian Brauner: "This annotates struct fdtable's fd array with __counted_by_ptr so KASAN and the fortified functions can bounds check it against max_fds and adds a KUnit suite for fdtable. A follow-up uses __struct_size() in the test since sparse doesn't know __builtin_dynamic_object_size(). FD_PREPARE() is simplified. It was built as an ACQUIRE-style guard on infrastructure that was never needed. The ACQUIRE machinery and CLASS_INIT() go away, the variable is declared with __cleanup() directly, struct fd_prepare loses its err field since the fd either holds the descriptor or the error, and callers get a const pointer to the guard behind a UNIQUE_ID() name so they can't shadow it. Code generation is identical" * tag 'vfs-7.4-rc1.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: file: make struct fd_prepare const and kill its err field cleanup: remove CLASS_INIT() file: declare the FD_PREPARE() variable with __cleanup() directly file: simplify FD_PREPARE() vfs: use __struct_size() in the fdtable KUnit test vfs: Add KUnit tests for fdtable vfs: Annotate struct fdtable's fd field with __counted_by_ptr
22 hoursMerge tag 'vfs-7.4-rc1.coredump' of ↵Linus Torvalds3-134/+380
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull coredump updates from Christian Brauner: "This adds sparse coredumps and per-request memory type selection to the coredump socket protocol. A coredump sent over the socket transfers every zero of every hole in every mapping. For a process with 128 threads that's 1 GB of mostly thread stacks, 8 MB reservations with a few pages touched, and the holes sit in the middle of the dump rather than at the end. The coredump_filter bit that was proposed for this stops each PT_LOAD at the last populated page. But that mask says which kinds of memory to include and propagates across fork and exec, whereas what is selected here is an encoding. The usermodehelper isn't salvagable for this either. The coredump socket already has a handshake for exactly this. A server that raises COREDUMP_RECORDS in coredump_ack->mask gets the coredump as a sequence of records, each a struct coredump_record_header followed by what it describes. The stream ends explicitly with an end record that reports the size, so a missing one means truncation. With COREDUMP_SPARSE holes cross the socket as a bare header that says how many zero bytes were skipped. Reassembling the records gives back the same coredump, so a debugger and everything else still see an ordinary core file. Numbers from the selftests: the 128 thread process sends 1424153 bytes for a coredump of 1075150848 bytes, a 256 MB mapping with the first and the last page touched sends 188793 bytes for 268890112 bytes, and with COREDUMP_RECORDS alone the record overhead is under one percent. The selftests also simulate a server uploading to a blob store that can't seek and rewrites the program headers so the object is an ordinary ELF core file without the holes. COREDUMP_MEMORY_TYPES lets the server choose what memory to dump per request instead of relying on the static /proc/<pid>/coredump_filter of the crashing task. The request carries the default types and a mask of every type the kernel knows about, the ack carries the selection. Zero is valid and dumps the program headers and notes and nothing but the mappings that are always dumped. Preparatory cleanups refuse negative skips in dump_skip_to(), chunk every write at a page so a pipe or a socket never takes a short write in the middle of a record, make the dump helpers return bool and replace the core_dumped integer with COREDUMP_STATE_STARTED and COREDUMP_STATE_TRUNCATED flags. Also included is a fix for coredump_parse() reading core_pattern while it is being modified. The sysctl handler now validates a copy and publishes it under a spinlock and the parser works on a snapshot, so a rejected pattern is never visible and the rollback logic goes away. And to_kthread()'s lockless flags read is annotated with READ_ONCE()" * tag 'vfs-7.4-rc1.coredump' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (29 commits) kthread: Annotate lockless to_kthread() flags access coredump: parse a snapshot of core_pattern selftests/coredump: test failed handshakes selftests/coredump: improve coredump size negotiation tests selftests/coredump: test COREDUMP_MEMORY_TYPES selftests/coredump: simplify the refusal tests tools: sync coredump.h header coredump: select memory types to include selftests/coredump: show how to inspect the task to decide how the coredump should be sent selftests/coredump: simulate a blob store selftests/coredump: put a hole in the middle of a sparse mapping selftests/coredump: hand the record stream to a sink selftests/coredump: test COREDUMP_RECORDS and COREDUMP_SPARSE coredump: describe the holes when COREDUMP_SPARSE is negotiated coredump: send the coredump in records if requested tools: sync coredump.h header coredump: add COREDUMP_SPARSE to the coredump socket protocol coredump: add COREDUMP_RECORDS to the coredump socket protocol coredump: clean up coredump state handling coredump: always chunk writes ...
22 hoursMerge tag 'vfs-7.4-rc1.close_range' of ↵Linus Torvalds1-36/+164
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull close_range updates from Christian Brauner: "This adds two new close_range() flags. CLOSE_RANGE_EXCEPT makes close_range() operate on all file descriptors outside of [fd, max_fd] instead of the ones inside. Alone it closes everything but the range. With CLOSE_RANGE_CLOEXEC it marks everything but the range close-on-exec. With CLOSE_RANGE_UNSHARE dup_fd() never takes a reference on what is dropped. So a task between clone(CLONE_FILES | CLONE_VM | CLONE_VFORK) and execve() that has the descriptors for the child in one window can shed the rest of the shared table in one call and nothing outside of the window is referenced by the child at any point. CLOSE_RANGE_CLOEXEC_ONLY closes the close-on-exec descriptors in the range and leaves everything else alone. Whatever the caller deliberately passes down, stdio, LISTEN_FDS, an inherited pipe, stays where it is. Combined with CLOSE_RANGE_EXCEPT it names the handful of close-on-exec descriptors that have to survive, the executable or an error pipe, and closes every other close-on-exec descriptor. Along the way dup_fd() stops copying a range in the middle of the table only to close it again. close_range(CLOSE_RANGE_UNSHARE) only avoided the copy when the range sat at the end of the table. Descriptors in a skipped range are never copied and no reference is taken on them, so ->flush() isn't called anymore for files from a table they were never part of. The flags are turned into an enum and selftests cover the window positions, the shared and the private table and the unshare form" * tag 'vfs-7.4-rc1.close_range' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: selftests/core: test CLOSE_RANGE_CLOEXEC_ONLY file: add CLOSE_RANGE_CLOEXEC_ONLY file: let dup_fd() drop only close-on-exec descriptors selftests/core: test CLOSE_RANGE_EXCEPT file: add CLOSE_RANGE_EXCEPT close_range: turn the flags into an enum file: let dup_fd() drop everything outside of the range file: rename dup_fd()'s punch_hole to range selftests/core: test the hole CLOSE_RANGE_UNSHARE leaves behind file: let dup_fd() leave the punched hole behind
22 hoursMerge tag 'vfs-7.4-rc1.binfmt' of ↵Linus Torvalds1-3/+9
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull binfmt updates from Christian Brauner: "This only lets punctuation delimit a binfmt_misc register string. Arbitrary delimiters never made sense and nothing uses them. Every new flag shrank the set of possible delimiters and made extensions more hazardous than they need to be. Letters, digits, whitespace, control characters, bytes above 0x7f and the backslash now get EINVAL. Everything deployed uses ':' anyway. This extends the fix that rejected a flag character as the delimiter. Selftests and documentation are included" * tag 'vfs-7.4-rc1.binfmt' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: binfmt_misc: document the field delimiter selftests/exec: test delimiter restrictions binfmt_misc: only let punctuation delimit a register string
22 hoursMerge tag 'vfs-7.4-rc1.bh' of ↵Linus Torvalds15-114/+133
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull buffer_head updates from Christian Brauner: "This stops the buffer_head write completion handlers from clearing BH_Uptodate when a write fails. A buffer whose write failed still holds exactly the data the filesystem asked to be written. It's the disk that is stale, not the buffer. Claiming otherwise has consequences. mark_buffer_dirty() warns when a filesystem redirties the buffer to retry the write, a buffer that isn't up to date gets re-read from disk which silently replaces the data with the stale on-disk copy, and the window between the write completing and BH_Uptodate being cleared is visible to anyone holding the folio lock. BH_Write_EIO already records that the last write failed. Every consumer is moved over to buffer_write_io_error(): the two core helpers in fs/buffer.c, adfs, ext2, omfs, exfat, fat, ext4, ocfs2, gfs2 and jbd2. Then write completion stops touching BH_Uptodate in both directions and BH_Write_EIO is cleared on successful completion instead of at submission, so a resubmission no longer hides an error that hasn't been fixed yet. bforget() and invalidation drop the flag so a reused block doesn't inherit someone else's write error. The groundwork for this removes b_page from struct buffer_head and lets a buffer_head point at memory outside the page cache. jbd2's shadow buffers sit on a slab folio today. A slab folio overloads ->mapping so mark_buffer_write_io_error() couldn't be called on them at all. They now point at the frozen data directly with b_folio NULL. Also included are documentation updates from Matthew for sb_bread(), sb_breadahead() and mmb_mark_buffer_dirty() and the removal of stale references to unmap_buffer() and mark_buffer_dirty_inode()" * tag 'vfs-7.4-rc1.bh' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (27 commits) buffer: Rename label buffer: Refer to folios in comments buffer: Document mmb_mark_buffer_dirty() buffer: Document sb_bread(), sb_bread_unmovable() and sb_breadahead() fs: Remove references to mark_buffer_dirty_inode() buffer: clear BH_Write_EIO when a write succeeds, not when one starts buffer: Remove reference to unmap_buffer() buffer: stop touching BH_Uptodate on write completion jbd2: check for a fast commit write error with buffer_write_io_error() jbd2: say what jbd2_freeze_jh_data()'s assertion is actually checking jbd2: report journal write errors with BH_Write_EIO gfs2: check for a metadata write error with buffer_write_io_error() ocfs2: check for a stale write error before reusing a metadata buffer ocfs2: check for a metadata write error with buffer_write_io_error() ext4: check for a metadata write error with buffer_write_io_error() fat: check for a metadata write error with buffer_write_io_error() exfat: check for a directory write error with buffer_write_io_error() omfs: check for an inode write error with buffer_write_io_error() ext2: check for an xattr block write error with buffer_write_io_error() adfs: check for a directory write error with buffer_write_io_error() ...
22 hoursMerge tag 'vfs-7.4-rc1.bfs' of ↵Linus Torvalds8-1197/+0
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull bfs removal from Christian Brauner: "This removes bfs, the filesystem UnixWare uses for its boot partition. It only supports contiguous files and has no subdirectories. The only data on such a partition are kernels and bootloader settings so there is no reason to access it from Linux anymore. The uapi header stays" * tag 'vfs-7.4-rc1.bfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: bfs: remove the filesystem
23 hoursMerge tag 'kernel-7.4-rc1.signal' of ↵Linus Torvalds3-21/+21
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull signal handling updates from Christian Brauner: "This stops TIF_NOTIFY_SIGNAL from interrupting work that can't be restarted and fixes a bunch of coredump and signal bugs. TIF_NOTIFY_SIGNAL kicks a task out of an uninterruptible sleep so it returns to userspace, runs its task work and goes back to sleep. That breaks coredumps: dump_interrupted() only lets fatal signals interrupt a dump and writes to a regular file ignore TIF_NOTIFY_SIGNAL. But the pipe and the socket paths check signal_pending() Adeep down in code that is shared with regular syscalls and bail. So a crashing process with io_uring requests in flight loses most of its coredump. In the selftest an unfixed kernel delivers 357324 of at least 5111808 bytes. And io_uring isn't the only source. klp_send_signals(), bpf_task_work_schedule_signal(), landlock's tsync, kthread_stop() and the printk kunit test raise the bit as well, some of them from irq context against any task. So this can't be fixed per subsystem and the state has to be per-task and ambient. Add PF_NO_NOTIFY_SIGNAL and no_notify_signal_save()/restore() helpers modelled on memalloc_nofs_save(). Inside such a section signal_pending() ignores TIF_NOTIFY_SIGNAL. Coredumps, the smb send path, which hand-rolled its own version of this, and the pid namespace reaper, which busy-looped when the bit kept getting raised, are converted. The second part is a set of fixes that fell out of looking at the coredump code with kres and modelling it in TLA+: - coredump_finish() woke the parked threads without holding rcu. A parked thread can exit on a spurious wakeup and be freed before wake_up_process() takes its pi_lock. - Only SIGKILL and the freezers interrupt a dump now and the three freezers agree. Power management and cgroup v1 freezing aborted a dump while a cgroup v2 freeze either waited for the dump or cut it short depending on where the core went. - io-wq set its exit bit without a barrier against the task work that creates workers. On weakly ordered architectures exit could hang on worker_done. - retarget_shared_pending() slingshotted a shared signal to the dumper when a zapped sibling restored its signal mask. That set TIF_SIGPENDING on the dumper and truncated the core. - A tracer could clear the signal mask of a user worker with PTRACE_SETSIGMASK and inject a coredump signal. An io-wq worker of an SQPOLL ring dumping core deadlocks the whole group. PTRACE_SETSIGMASK is refused for user workers now and __set_task_blocked() enforces the fork-time mask. - exec cancels io_uring requests before de_thread() so a worker creation queued as task work can't add a thread to a thread group that de_thread() just took down. - No io threads are created from a PF_SIGNALED or PF_POSTCOREDUMP creator anymore. Such a worker was invisible to zap_process() but still decremented threads_remaining on exit so the dumper could leave coredump_wait_inactive() early. Also included are a comment that do_each_pid_task() needs tasklist_lock, a READ_ONCE() in pid_alive() and a regression test for fork() into a pid namespace whose ancestor lost its init" * tag 'kernel-7.4-rc1.signal' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (21 commits) pid: use READ_ONCE() in pid_alive() selftests: pid_namespace: test fork with dead ancestor pid: document that do_each_pid_task() needs tasklist_lock signal: enforce the user worker signal mask in __set_task_blocked() fork: use SIG_KERNEL_ONLY_MASK for the user worker signal mask fork: don't create io threads once PF_POSTCOREDUMP is set fork: move the coredump and exec checks into create_io_thread() exec: cancel io_uring requests before de_thread() selftests/coredump: expect PTRACE_SETSIGMASK to be refused on a user worker selftests/coredump: test a user worker as the coredumping thread ptrace: refuse to change the signal mask of a user worker selftests/coredump: test shared signal retargeting during a dump signal: only SIGKILL and the freezers interrupt a coredumping task signal: don't retarget shared signals in a dying thread group io-wq: order the exit bit against worker creation task work coredump: hold RCU while releasing parked threads pid_namespace: prevent TIF_NOTIFY_SIGNAL from interrupting the reaper smb: prevent TIF_NOTIFY_SIGNAL from interrupting selftests/coredump: test that TIF_NOTIFY_SIGNAL doesn't truncate a coredump coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps ...
23 hoursMerge tag 'namespace-7.4-rc1.misc' of ↵Linus Torvalds1-2/+0
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull namespace updates from Christian Brauner: - Reject uid_map, gid_map and projid_map values that don't fit in a u32. map_write() parsed with simple_strtoul() and truncated modulo 2^32 on 64-bit so "4294967301 1000 1" was installed as "5 1000 1" without an error. Each field is parsed with kstrtou32() now and selftests cover the out-of-range, negative and in-range cases. This isn't a security fix. The truncated values were valid ids and every later check still applied to them. - Annotate struct uid_gid_map's forward and reverse pointers with __counted_by_ptr and add a KUnit suite for inserting and sorting extents. insert_extent() wrote to forward[nr_extents] before bumping the count which the annotation flags, so it bumps first now. Two follow-up fixes rename the now global helpers to uid_gid_map_insert_extent() and uid_gid_map_sort(), since the btrfs self-tests have their own insert_extent(), and guard the declarations on CONFIG_KUNIT. - Drop the BUG_ON() NULL checks in copy_mnt_ns() and copy_utsname(). create_new_namespaces() always passes a valid pointer and the other copy_*_ns() helpers don't check either. - Remove a