summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
10 daysPCI/ACPI: Centralize pcie_ports_native checkingKuppuswamy Sathyanarayanan
If the user booted with "pcie_ports=native", we take control of the PCIe port services unconditionally, regardless of what _OSC says. Centralize the testing of pcie_ports_native in acpi_pci_root_create(), where we interpret the _OSC results, so other places only have to check host_bridge->native_X and we don't have to sprinkle tests of pcie_ports_native everywhere. Rather than overriding the host_bridge->native_X flags after the fact, fold "pcie_ports=native" into the _OSC control mask we evaluate, i.e., proceed as though the platform had granted control of the port services. That way there is a single mechanism deciding each native_X flag, and we can report exactly which features we are overriding _OSC for instead of just noting that we are overriding something: acpi PNP0A08:00: _OSC: OS forcing control ("pcie_ports=native") of [PCIeHotplug PME AER DPC] Forcing host_bridge->native_aer also restores DPC service binding under "pcie_ports=native", which regressed in commit 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS controls AER"). That commit replaced the AER service test in get_port_device_capability() with host->native_aer, so DPC stayed off when host_bridge->native_aer was not set. This also extends "pcie_ports=native" to host_bridge->native_dpc, which had no pcie_ports_native fallback before. That effect is narrow. native_dpc is only consumed by pci_dpc_recovered(), where with CONFIG_PCIE_EDR=n it previously gave up immediately and now lets pciehp wait for DPC recovery before treating a Link Down as a hotplug event. Fold "pcie_ports=dpc-native" into the control mask the same way, so host_bridge->native_dpc reflects it as well, with the same narrow effect on pci_dpc_recovered(). Move the pcie_ports_dpc_native declaration to <linux/pci.h> so acpi_pci_root_create() can test it. host_bridge->native_ltr is deliberately not forced. "pcie_ports=" controls PCIe port services and LTR is not one. There is no PCIE_PORT_SERVICE_LTR, and native_ltr is only used by pci_configure_ltr() to enable ASPM L1.2, so forcing it would be an ASPM policy decision users did not ask for. SHPC hotplug is left alone for a simpler reason: SHPC is a conventional PCI feature rather than a PCIe one, so "pcie_ports=" has no bearing on it. Fixes: 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS controls AER") Closes: https://lore.kernel.org/linux-pci/20260901064554.2178688-1-kanie@linux.alibaba.com/ Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Guixin Liu <kanie@linux.alibaba.com> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> # ACPI core Link: https://patch.msgid.link/20261002211828.1293177-4-sathyanarayanan.kuppuswamy@linux.intel.com
10 daysBluetooth: MGMT: Fix advertising instances with Global AdvertisingLuiz Augusto von Dentz
Global Advertising, enabled with MGMT_OP_SET_ADVERTISING, uses instance 0 and with extended advertising it has its own advertising set, but instances were still being treated as if they shared the same set: - Add Advertising and Add Extended Advertising Data would return success without ever enabling the instance. - Removing the last instance would disable all advertising sets, stopping Global Advertising while leaving its setting enabled. - Disabling Global Advertising would disable all sets, including active instances. Fix this by only overriding instances that share the advertising set of Global Advertising, and by tracking HCI_LE_ADV_0 rather than HCI_LE_ADV to determine the state of Global Advertising. Fixes: 0d92808024b4 ("Bluetooth: HCI: Fix tracking of advertisement set/instance 0x00") Assisted-by: OpenCode:claude-opus-5.5 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
10 daysMerge tag 'thunderbolt-for-v7.4-rc1' of ↵Greg Kroah-Hartman
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v7.4 merge window This includes following USB4/Thunderbolt changes for the v7.4 merge window: - Add quirk for ASMedia controller. - Add device links for Apple machines with Intel Ice Lake and Titan Ridge controllers. - Thunderbolt networking improvements. - USB4STREAM improvements. - Add support for extended error counters. - Minor fixes and cleanups. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v7.4-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (24 commits) thunderbolt: stream: Make read return framing error to the userspace thunderbolt: Extract per-lane extended error counters in software margining thunderbolt: Fix sideband register access in usb4_port_sw_margin_errors() thunderbolt: Add extended error counter support for software lane margining thunderbolt: Define number of dwords for hardware margining results thunderbolt: Make software margining error counter configurable thunderbolt: stream: Improve CLOSE handling on write side thunderbolt: stream: Check the Rx ring before task starts sleeping thunderbolt: stream: Do not hold the lock while busy polling thunderbolt: Add tb_ring_poll_pending() thunderbolt: Write descriptors in tb_ring_poll() thunderbolt: stream: Use polling with RX ring thunderbolt: Use shadow copy for ring interrupt mask thunderbolt: Clean up ring interrupt register indexing thunderbolt: Do not WARN about already disabled interrupt on polled rings thunderbolt: Fix typo "forwared" in comment thunderbolt: Add device links for Apple systems with Ice Lake thunderbolt: Add device links for Apple machines with Titan Ridge thunderbolt: Move tb_apple_add_links() to pci.c net: thunderbolt: Update ring indices only after all frames are queued ...
10 daysnetfs: Remove folio_queueDavid Howells
Remove folio_queue as it's no longer used. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-11-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Christoph Hellwig <hch@infradead.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysiov_iter: Remove ITER_FOLIOQDavid Howells
Remove ITER_FOLIOQ as it's no longer used. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-10-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Christoph Hellwig <hch@infradead.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Switch folioq to bvecqDavid Howells
In netfslib, perform more or less a straight switch from using folio_queue to using bvecq to hold the lists of folios involved in various sorts of buffered read and in buffered writeback. It's not quite a straight swap, however, because: (1) The bveq_alloc_*() routines want to know if the callers is doing writeback for emergency pool use. (2) folio_queue includes a fixed capacity folio_batch, but bvecq has a variable size bio_vec array. (3) folio_queue has a set of per-folio marks that are mostly unused; the one exception is for netfs_prefetch_for_write() - but the marked folio is then ignored because no_unlock_folio points to it (and the bvecq mem cleanup type can handle that anyway). This will become an issue if/when netfs_prefetch_for_write() expands the read to cope with large cache granularity. (4) The bvecq API doesn't have functions to get a folio's length or to clear a folio pointer by slot, instead accessing the bio_vec array directly. Also bvecq stores the folio length in bv_len instead of storing the folio orders. (5) rolling_buffer_bulk_load_from_ra() needs to work a bit differently as the folio_queue contains a folio_batch and bvecq doesn't. (6) rolling_buffer_delete_spent() has to clear the bvecq->next pointer before putting the bvecq to avoid rolling up the entire list. On the other hand, rolling_buffer_clear() just needs to put the tail. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-8-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Namjae Jeon <linkinjeon@kernel.org> cc: Shyam Prasad N <sprasad@microsoft.com> cc: Tom Talpey <tom@talpey.com> cc: Christoph Hellwig <hch@infradead.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Add some tools for managing bvecq chainsDavid Howells
Provide a selection of tools for managing bvec queue chains and a memory pool for writeback to draw upon if needed. The tools include the allocation, prepopulation and refcounting of bvecqs and bvecq chains. When a chain is being cleaned up, the memory segments will be appropriately disposed off according to the flags on each bvecq in that chain, allowing for mixed memory cleanup types. The main use for this is to replace the use of both folio_queues and kvmalloc'd bio_vec arrays in netfslib and creating a structure that allows network filesystems to easily build an entire message by gluing bits of protocol on either side of the bvecq chains and also glue chains together for sparse writes and compound operations. This allows TCP-based transports to pass a message in a single sendmsg() call and avoid corking as this makes things more efficient. This will also be used to do things like creating an encryption buffer in cifs or a directory content buffer in afs. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-4-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Christoph Hellwig <hch@infradead.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysiov_iter: Add a segmented queue of bio_vec[]David Howells
Add the concept of a segmented queue of bio_vec[] arrays. This allows an indefinite quantity of elements to be handled and allows things like network filesystems and crypto drivers to glue bits on the ends without having to reallocate the array. The bvecq struct that defines each segment also carries capacity/usage information along with flags indicating whether the constituent memory regions need freeing or unpinning. The bvecq structs are refcounted to allow a queue to be extracted in batches and split between a number of subrequests. The bvecq can have the bio_vec[] it manages allocated in with it, but this is not required. A flag is provided for if this is the case as comparing ->bv to ->__bv is not sufficient to detect this case. Add an iterator type ITER_BVECQ for it. This is intended to replace ITER_FOLIOQ (and ITER_XARRAY). Note that the prev pointer is only really needed for iov_iter_revert() and could be dispensed with if struct iov_iter contained the head information as well as the current point. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-3-dhowells@redhat.com Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Jens Axboe <axboe@kernel.dk> cc: Christoph Hellwig <hch@infradead.org> cc: linux-block@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysAdd a function to kmap one page of a multipage bio_vecDavid Howells
Add a function to kmap one page of a multipage bio_vec by offset (which is added to the offset in the bio_vec internally). The caller is responsible for calculating how much of the page is then available. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20261001091239.3343034-2-dhowells@redhat.com Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Jens Axboe <axboe@kernel.dk> cc: Christoph Hellwig <hch@infradead.org> cc: linux-block@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 dayscachefiles: Don't rely on backing fs storage map for most use casesDavid Howells
Cachefiles currently uses the backing filesystem's idea of what data is held in a backing file and queries this by means of SEEK_DATA and SEEK_HOLE. However, this means it does two seek operations on the backing file for each individual read call it wants to prepare (unless the first returns -ENXIO). Worse, the backing filesystem is at liberty to insert or remove blocks of zeros in order to optimise its layout which may cause false positives and false negatives. The problem is that keeping track of what is dirty is tricky (if storing info in xattrs, which may have limited capacity and must be read and written as one piece) and expensive (in terms of diskspace at least) and is basically duplicating what a filesystem does. However, the most common write case, in which the application does { open(O_TRUNC); write(); write(); ... write(); close(); } where each write follows directly on from the previous and leaves no gaps in the file is reasonably easy to detect and can be noted in the primary xattr as CACHEFILES_CONTENT_ALL, indicating we have everything up to the object size stored. In this specific case, given that it is known that there are no holes in the file, there's no need to call SEEK_DATA/HOLE or use any other mechanism to track the contents. That speeds things up enormously. Even when it is necessary to use SEEK_DATA/HOLE, it may not be necessary to call it for each cache read subrequest generated. Implement this by adding support for the CACHEFILES_CONTENT_ALL content type (which is defined, but currently unused), which requires a slight adjustment in how backing files are managed. Specifically, the driver needs to know how much of the tail block is data and whether storing more data will create a hole. To this end, the way that the size of a backing file is managed is changed. Currently, the backing file is expanded to strictly match the size of the network file, but this can be changed to carry more useful information. This makes two pieces of metadata available: xattr.object_size and the backing file's i_size. Apply the following schema: (a) i_size is always a multiple of the DIO block size. (b) i_size is only updated to the end of the highest write stored. This is used to work out if we are following on without leaving a hole. (c) xattr.object_size is the size of the network filesystem file cached in this backing file. (d) xattr.object_size must point after the start of the last block (unless both are 0). (e) If xattr.object_size is at or after the block at the current end of the backing file (ie. i_size), then we have all the contents of the block (if xattr.content == CACHEFILES_CONTENT_ALL). (f) If xattr.object_size is somewhere in the middle of the last block, then the data following it is invalid and must be ignored. (g) If data is added to the last block, then that block must be fetched, modified and rewritten (it must be a buffered write through the pagecache and not DIO). (h) Writes to cache are rounded out to blocks on both sides and the folios used as sources must contain data for any lower gap and must have been cleared for any upper gap, and so will rewrite any non-data area in the tail block. To implement this, the following changes are made: (1) cookie->object_size is no longer updated when writes are copied into the pagecache, but rather only updated when a write request completes. This prevents object size miscomparison when checking the xattr causing the backing file to be invalidated (opening and marking the backing file and modifying the pagecache run in parallel). (2) The cache's current idea of the amount of data that should be stored in the backing file is kept track of in object->object_size. Possibly this is redundant with cookie->object_size, but the latter gets updated in some addition circumstances. (3) The size of the backing file at the start of a request is now tracked in struct netfs_cache_resources so that the partial EOF block can be located and cleaned. (4) The cache block size is now used consistently rather than using CACHEFILES_DIO_BLOCK_SIZE (4096). (5) The backing file size is no longer adjusted when looking up an object. (6) When shortening a file, if the new size is not block aligned, the part beyond the new size is cleared. If the file is truncated to zero, the content_info gets reset to CACHEFILES_CONTENT_NO_DATA. (7) A new struct, fscache_occupancy, is instituted to track the region being read. Netfslib allocates it and fills in the start and end of the region to be read then calls the ->query_occupancy() method to find and fill in the extents. It also indicates whether a recorded extent contains data or just contains a region that's all zeros (FSCACHE_EXTENT_DATA or FSCACHE_EXTENT_ZERO). (8) The ->prepare_read() cache method is changed such that, if given, it just limits the amount that can be read from the cache in one go. It no longer indicates what source of read should be done; that information is now obtained from ->query_occupancy(). (9) A new cache method, ->collect_write(), is added that is called when a contiguous series of writes have completed and a discontiguity or the end of the request has been hit. It it supplied with the start and length of the write made to the backing file and can use this information to update the cache metadata. (10) cachefiles_query_occupancy() is altered to find the next two "extents" of data stored in the backing file by doing SEEK_DATA/HOLE between the bounds set - unless it is known that there are no holes, in which case a whole-file first extent can be set. (11) cachefiles_collect_write() is implemented to take the collated write completion information and use this to update the cache metadata, in particular working out whether there's now a hole in the backing file requiring future use of SEEK_DATA/HOLE instead of just assuming the data is all present. It also uses fallocate(FALLOC_FL_ZERO_RANGE) to clean the part of a partial block that extended beyond the old object size. It might be better to perform a synchronous DIO write for this purpose, but that would mandate an RMW cycle. Ideally, it should be all zeros anyway, but, unfortunately, shared-writable mmap can interfere. (12) cachefiles_begin_operation() is updated to note the current backing file size and the cache DIO size. (13) cachefiles_create_tmpfile() no longer expands the backing file when it creates it. (14) cachefiles_set_object_xattr() is changed to use object->object_size rather than cookie->object_size. (15) cachefiles_check_auxdata() is altered to actually store the content type and to also set object->object_size. The cachefiles_coherency tracepoint is also modified to display xattr.object_size. (16) netfs_read_to_pagecache() is reworked. The cache ->prepare_read() method is replaced with ->query_occupancy() as the arbiter of what region of the file is read from where, and that retrieves up to two occupied extents of the backing file at once. The cache ->prepare_read() method is now repurposed to be the same as the equivalent network filesystem method and allows the cache to limit the size of the read before the iterator is prepared. netfs_single_dispatch_read() is similarly modified. (17) netfs_update_i_size() and afs_update_i_size() no longer call fscache_update_cookie() to update cookie->object_size. (18) Write collection now collates contiguous sequences of writes to the cache and calls the cache ->collect_write() method. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260910220242.2165023-5-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 dayscachefiles: Add a tracepoint to log insufficient space errorsDavid Howells
Add a tracepoint to log insufficient space errors. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260910220242.2165023-4-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Marc Dionne <marc.dionne@auristor.com> cc: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs, cachefiles: Add a couple of traces for write failureDavid Howells
Add a couple of subrequest traces for write failure in the cache. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260910220242.2165023-3-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Marc Dionne <marc.dionne@auristor.com> cc: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Add some functions to wrap the all-queued handlingDavid Howells
Add some helper functions to wrap the handling of the NETFS_RREQ_ALL_QUEUED flag and to insert the appropriate barriers. Also add an smb_mb__after_atomic() after the set_bit() to make sure stuff after the set_bit() in the same thread doesn't get ordered before. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-8-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Make deprecated PG_private_2 support opt-inDavid Howells
Make the deprecated PG_private_2 support opt-in, requiring it to be selected by the filesystems that might want to use it. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-7-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Trond Myklebust <trondmy@kernel.org> cc: Anna Schumaker <anna@kernel.org> cc: Ilya Dryomov <idryomov@gmail.com> cc: Alex Markuze <amarkuze@redhat.com> cc: Viacheslav Dubeyko <slava@dubeyko.com> cc: netfs@lists.linux.dev cc: linux-nfs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Add the cache object ID to netfs_read/write tracepointsDavid Howells
Add the cache object debug ID to netfs_read/write tracepoints to make debugging easier as there's now a direct cross-reference with the cachefiles tracepoints that only log that debug ID. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-6-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: trace: Rejig a couple of the tracepointsDavid Howells
Rejig the following tracepoints: (1) Change netfs_folio to show the pfn. (2) Change netfs_collect_folio to show a folio index range rather than file position range and don't show the cleaned_to or collected_to points. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-5-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: trace: Change the "clear" folio traces to "endwb"David Howells
Change the "clear" folio traces to "endwb" as it's more obvious what it means. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-4-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Remove the writethrough codeDavid Howells
Remove the netfs writethrough code as it's very tricky to get the locking right and it will probably deadlock if used in conjunction with Ceph snapshots because it excludes writeback for the duration, but to flush out old snapshots, it does a synchronous flush that invokes writeback. Instead, O_SYNC writes do a flush after performing the write - which is already there as the callers of netfs_perform_write() all call generic_write_sync(). Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-3-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysnetfs: Use uoff_t instead of unsigned long long and loff_tDavid Howells
Use uoff_t instead of unsigned long long and loff_t for file positions that can't be negative. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260909072105.1663687-2-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
10 daysMerge tag 'printk-for-7.3-rc7' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fix from Petr Mladek: - Allow using Braille console with a serial console driver converted to NBCON API * tag 'printk-for-7.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: braille: nbcon: Allow to use a serial console with NBCON API as Braille console
10 daysseccomp: Document RESTART_BEFORE_RECV and O_PATH addfdKees Cook
Describe SECCOMP_FILTER_FLAG_RESTART_BEFORE_RECV in the UAPI header, as SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV is described above it, and say in the documentation that supervisors must tolerate ENOENT from SECCOMP_IOCTL_NOTIF_RECV, which the flag makes routine. Note at the fget_raw() call that O_PATH files are allowed on purpose. Build tested ARCH=x86_64 defconfig (kernel/seccomp.o and headers) with GCC 16.2.0, and SPHINXDIRS=userspace-api htmldocs. Assisted-by: LLM Signed-off-by: Kees Cook <kees@kernel.org>
10 daysseccomp: allow restarting interrupted unreceived notificationsCong Wang
An interrupted user notification wait returns ERESTARTSYS before the syscall body has run. If the notifying task's handler for the delivered signal was installed without SA_RESTART, that task sees EINTR even for calls whose callers do not expect it. This can make fork fail unexpectedly or make close report EINTR while leaving the descriptor open. A leaked pipe write end can prevent readers from seeing EOF. The supervisor cannot repair this result once the interrupted task removes the notification. If removal happens before receipt, the supervisor never receives that request; a reply using its ID would fail with ENOENT. Receiving notifications eagerly only narrows the scheduling window. WAIT_KILLABLE_RECV protects supervisor processing after receipt, but deliberately leaves the pre-receive wait interruptible. A sandbox also cannot transparently fix this in the target. It cannot require arbitrary workloads to retry calls such as fork and close. Retrying close on EINTR is unsafe when the native syscall has already released the descriptor. Forcing SA_RESTART on application handlers would change cancellation behavior for other blocking calls. Sandlock encounters this while mediating process creation to enforce process limits. For example, dash installs its SIGCHLD handler without SA_RESTART. While dash is creating a pipeline, an earlier child can exit and generate SIGCHLD while dash waits for a fork notification to be received. The interrupted wait then makes fork return EINTR, causing dash to report "Cannot fork". Removing fork from notification mediation would bypass the process-limit enforcement that sandlock needs. Add SECCOMP_FILTER_FLAG_RESTART_BEFORE_RECV, requiring NEW_LISTENER. Under notify_lock, convert an interrupted wait's ERESTARTSYS to ERESTARTNOINTR only while the notification remains INIT. The notifying task's signal handler still runs; if it returns normally, syscall entry and the filter are evaluated again. Keep this opt-in because commit c2aa2dfef243 ("seccomp: Add wait_killable semantic to seccomp user notifier") deliberately preserved pre-receipt interruption so workloads could abandon requests before the supervisor starts processing them. The flag can be combined with WAIT_KILLABLE_RECV to defer non-fatal signals after receipt. Neither supervisor-supplied errors nor the native syscall's restart behavior is changed. Assisted-by: Codex:gpt-6 Signed-off-by: Cong Wang <cwang@multikernel.io> Link: https://patch.msgid.link/20260924204209.477694-2-xiyou.wangcong@gmail.com Signed-off-by: Kees Cook <kees@kernel.org>
10 daysMerge branches 'clk-tenstorrent' and 'clk-samsung' into clk-nextBrian Masney
10 daysdevres: Provide kmalloc_obj*-style API for devm_kmallocKees Cook
Mirroring the type-based allocation now in use for the kmalloc family of APIs, provide the same for the devm_kmalloc family of APIs. This will allow for future plumbing of type information (e.g. alignment) into the underlying allocations. This immediately gains type check on return values (instead of the prior "void *" return type). Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/20260914223219.901347-2-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
10 daysmm: Move default_gfp() into gfp_types.hKees Cook
Using default_gfp() only depends on the GFP_KERNEL value. Move default_gfp() into gfp_types.h so that future use in devres.h doesn't require pulling in all of gfp.h. Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Reviewed-by: Zi Yan <ziy@nvidia.com> Link: https://patch.msgid.link/20260914223219.901347-1-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
10 daysnet: remove IPX raw 802.3 detection from eth_type_trans()Eric Dumazet
eth_type_trans() and vlan_set_encap_proto() still carry a "magic hack" to spot Novell raw 802.3 frames (IPX directly over 802.3, without an 802.2 LLC header) by looking for 0xFFFF in the first two bytes of the payload, and report them as ETH_P_802_3. IPX was removed in commit 7a2e838d28cf ("staging: ipx: delete it from the tree") and there is no in-kernel packet handler for ETH_P_802_3 on the Ethernet receive path anymore. Simply classify all frames using a length field as ETH_P_802_2, which is what the remaining LLC users (STP, GARP, SNAP) register for. This removes a skb_header_pointer() call (and the skb->dev scratch trick used to avoid a stack canary) from eth_type_trans(), and lets skb_vlan_untag() only pull VLAN_HLEN bytes, as the extra two bytes were only needed for this check since commit 55eff0eb7460 ("net: Fix potential wrong skb->protocol in skb_vlan_untag()"). Note that such frames are now reported to AF_PACKET, tc, BPF and nftables with skb->protocol == ETH_P_802_2 instead of ETH_P_802_3. $ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/0 grow/shrink: 2/5 up/down: 33/-187 (-154) Function old new delta skb_shift 1736 1768 +32 eth_type_trans.cold 45 46 +1 skb_vlan_untag 690 678 -12 __skb_vlan_pop 489 477 -12 nf_flow_encap_pop 462 449 -13 eth_type_trans 354 220 -134 Total: Before=31212910, After=31212756, chg -0.00% Signed-off-by: Eric Dumazet <edumazet@kernel.org> Link: https://patch.msgid.link/20261002185509.17226-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daystcp: add tp->tcp_nospaceEric Dumazet
tcp_check_space() runs for every incoming ACK and for every packet we send, and reads SOCK_NOSPACE from sk->sk_socket->flags. struct socket lives in its own cache line, which the TCP fast paths do not otherwise touch, so testing sk->sk_socket->flags pulls in an extra cache line that is cold when the working set is large. Add tp->tcp_nospace, a mirror of SOCK_NOSPACE placed right after tp->chrono_type in the tcp_sock_write_tx group, in a cache line both the transmit and the ACK paths already touch (bytes_sent, data_segs_out, delivered, bytes_acked, chrono_type). It fits in an existing 3-byte hole before chrono_start, so no other field moves and sizeof(struct tcp_sock) is unchanged. The two flags are now only changed from sk_set_nospace() and sk_clear_nospace(), which maintain this invariant: SOCK_NOSPACE set => tp->tcp_nospace set sk_set_nospace() sets SOCK_NOSPACE before tp->tcp_nospace (using smp_mb__after_atomic() and smp_store_mb()), while sk_clear_nospace() clears tp->tcp_nospace before SOCK_NOSPACE (using smp_mb__before_atomic()). If a lockless sk_set_nospace() from tcp_poll() races with sk_clear_nospace() and SOCK_NOSPACE ends up set, set_bit(SOCK_NOSPACE) happened after clear_bit(SOCK_NOSPACE), so tp->tcp_nospace = 1 happens after tp->tcp_nospace = 0 as well. tcp_check_space() can thus test tp->tcp_nospace alone and leave the authoritative SOCK_NOSPACE test to __tcp_check_space(). The invariant is one directional on purpose: a stale tp->tcp_nospace only costs an extra call to __tcp_check_space(), which is what we do unconditionally today, while a stale SOCK_NOSPACE would cost a missed EPOLLOUT. Note the smp_mb() is kept. tcp_poll() sets the flag without the socket lock, and the store-buffer pattern it forms with tcp_check_space() needs a full barrier on both sides. MPTCP subflows share the struct socket of their parent, hence its SOCK_NOSPACE bit, which can not be mirrored in the subflow tcp_sock. Pin their tp->tcp_nospace in subflow_ulp_init(), so that they always reach __tcp_check_space() and keep the current behavior. Microbenchmark on an AMD EPYC 7B13, 64 threads, each thread calling tcp_check_space() in a loop over a private set of sockets. Numbers are cycles per call above a baseline loop that performs the work the callers already did (the cache lines tcp_write_xmit() and tcp_clean_rtx_queue() touched) but not tcp_check_space() itself, so they are the marginal cost of the function. Median of 11 runs. The set size controls whether struct socket is still cached: sockets/thread before after 1 +0.6 +0.7 256 (64 KB) +8.3 +3.9 4096 (1 MB) +22.4 +1.1 262144 (64 MB) +48.4 -0.8 Signed-off-by: Eric Dumazet <edumazet@kernel.org> Link: https://patch.msgid.link/20260929071743.23624-10-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysnet: add sk_set_nospace() and sk_clear_nospace()Eric Dumazet
SOCK_NOSPACE lives in sk->sk_socket->flags and is manipulated from about thirty places in the tree, all of them open coding the sk->sk_socket dereference, some with a NULL check, some without, and some reaching the struct socket by yet another path. Add sk_set_nospace() and sk_clear_nospace() helpers and convert the core networking setters and clearers to them; the following patches convert the remaining subsystem callers so that "git grep _bit(SOCK_NOSPACE" only reports the two helpers and the remaining test_bit() sites. Callers that had no NULL check are all called from user context with a socket attached, so folding the check into the helpers only makes them more robust. No functional change intended. This is a preparation patch: a following one gives TCP a cheaper private copy of this bit, and needs a single choke point to keep it in sync. Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Signed-off-by: Eric Dumazet <edumazet@kernel.org> Link: https://patch.msgid.link/20260929071743.23624-3-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysnet: strparser: removed the aborted bit and aborts counterSabrina Dubroca
strp->aborted is never set, so the aborts counter is also never updated. Remove them, and hard-code a 0 in kcm_stats_seq_show() to preserve the user-visible format. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link/53d83ac52f192a7cf2a8decaf72d454cbb86211a.1790702233.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysnet: strparser: remove strp_process()Sabrina Dubroca
It's unused. Then we can revert the changes that commit bbb03029a899 ("strparser: Generalize strparser") did to extract __strp_recv(). Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link/04c57c1e928ec2a94a71413b49b6bec68a71c39d.1790702233.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysnet: strparser: remove unused abort_parser/lock/unlock callbacksSabrina Dubroca
The lock/unlock callbacks were introduced in 2017 (bbb03029a899 ("strparser: Generalize strparser")) and haven't been used. The abort_parser callback has existed since strp was committed (2016) and has also never been used. This patch replaces those indirections with the only possible direct call. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link/e55bcc033317dddd47a6dfda6575c755ae7175f7.1790702233.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysipv4: use zero IPID for atomic datagrams on connected socketsEric Dumazet
ip_select_ident_segs() uses the per-socket private generator for connected sockets, even for packets with IP_DF set. This was historically done to work around buggy Windows95/2000 VJ header compression implementations, dropping every other packet in a TCP stream when the IP ID field did not change. RFC 6864 section 4.2 states that "Originating sources MAY set the IPv4 ID field of atomic datagrams to any value". Packets with IP_DF set and skb->ignore_df cleared can not be fragmented, neither locally (ip_fragment() refuses to do so) nor by routers on the path. Set their IPID to zero, like we already do for unconnected sockets and in ip_build_and_send_pkt(). FreeBSD also does the same by default (net.inet.ip.rfc6864 = 1). For GSO packets, segments get IP IDs 0, 1, ..., n-1 from GSO/TSO. This does not hurt GRO on receivers, because TCP already forces a PSH flag on every TSO packet since commit 051ba67447de ("tcp: force a PSH flag on TSO packets"), so GRO already flushes at TSO packet boundaries. Connected sockets still use their private generator for packets without IP_DF, or with skb->ignore_df set. Update the inet_id kernel-doc accordingly. This avoids an atomic operation on a shared cache line for connected UDP sockets using IP_PMTUDISC_DO/IP_PMTUDISC_PROBE, and TCP no longer touches inet->inet_id in the fast path. Minor side effects: IP IDs can no longer be used to distinguish network duplicates from TCP retransmits, or to correlate packet captures taken at different points. OS fingerprints will also change. Signed-off-by: Eric Dumazet <edumazet@kernel.org> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20261001155633.2562504-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysipv4: fix IP ID reuse in ip_select_ident_segs()Eric Dumazet
ip_select_ident_segs() must put the first of the @segs reserved IP IDs in iph->id, as GSO assigns id, id + 1, ..., id + segs - 1 to segments. Commit f866fbc842de ("ipv4: fix data-races around inet->inet_id") used atomic_add_return() for non-TCP sockets, which returns the first ID of the next packet instead. Consecutive GSO packets can then reuse IP IDs. SCTP GSO is affected. Other callers use segs == 1, and only see a harmless off-by-one (UDP GSO has a separate, older issue). Use atomic_fetch_add() instead, like the TCP path. Fixes: f866fbc842de ("ipv4: fix data-races around inet->inet_id") Signed-off-by: Eric Dumazet <edumazet@kernel.org> Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260930144018.1174068-2-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 daysdrm: nova: Move VRAM BAR size query to GPU infoDanilo Krummrich
Nova exposes static information via its DRM_IOCTL_NOVA_INFO ioctl, thus add vram_bar_size to struct drm_nova_info_gpu and remove DRM_IOCTL_NOVA_GETPARAM and its uAPI definitions. This breaks the uAPI, which is still fine at this point. It requires the corresponding drm-test change in [1]. Link: https://gitlab.freedesktop.org/dakr/drm-test/-/merge_requests/2 [1] Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Alistair Popple <apopple@nvidia.com> Link: https://patch.msgid.link/20260927142258.1260711-1-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
10 daysMerge ras/edac-urgent into for-nextBorislav Petkov (AMD)
* ras/edac-urgent: (1107 commits) EDAC/amd64: Mask UMC chip select to the four implemented selects Linux 7.3-rc6 Input: atkbd - skip deactivate for Lenovo IdeaPad Slim 3 15IWC11 PCI: Accept AtomicOps already enabled by the hypervisor bpf: Fix missing migration protection in __rhtab_map_lookup_and_delete_batch() random: vDSO: avoid call to memset() when zeroing reserved parameter futex: Fix private hash use-after-free on resize irq: Make refcount_interrupt kunit test selectable tty: add missing driver flag kernel-doc colon kprobes: Skip disarmed probes when checking optkprobe overlap drm/mediatek: Fix ovl adaptor platform device leak drm/mediatek: Fix runtime PM leak in mtk_hdmi_ddc_v2_probe() drm/mediatek: Fix pdev reference leak in mtk_drm_bind() drm/amdgpu: reset VI ASIC on MacBookPro14,3 drm/amd/pm/si: Fix updating clock limits on AC/DC drm/amd/display: Fix stale replay_events after mod_power stream removal drm/radeon: Read the VRAM VBIOS signature with readb() drm/amd/display: guard dc_sink dereferences in MST mode validation drm/amd/display: Try RGB before YCbCr 4:4:4 in stream validation drm/amd/display: Fix sanitizer check for the DML frame size limit ... Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
11 daysMerge tag 'nxpwifi-next-20260929-v3' of ↵Johannes Berg
https://github.com/nxp-upstream/nxpwifi-next Jeff Chen says: =============== nxpwifi patches for Linux v7.4 (PR #1) - Add IW610 SDIO support - Fix error handling issues - Add bounds checking for debugfs output - Validate variable-length IE parsing =============== Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 daysio_uring: cleanup the io_uring_attr_pi definitionChristoph Hellwig
Remove double-tabs for the members, and make the comment describing the struct a bit more detailed. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261005141954.1353351-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 daysdmaengine: dw-edma: Configure remote interrupt routingKoichiro Den
An endpoint function can reserve an endpoint-local channel while the RC programs it through an exposed register window. Such a channel must route interrupts remotely and ignore them on the endpoint. Use dma_slave_config to set per-channel interrupt routing on idle channels of a local eDMA or HDMA instance. Releasing a remote-routed channel quiesces the hardware and drains its local IRQ before restoring default routing. The eDMA quiesce may stop a complete direction. The caller must own every channel in that direction and stop remote programming first. Suggested-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Koichiro Den <den@valinux.co.jp> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260912174023.1227397-3-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>
11 daysdmaengine: Allow drivers to assign static channel IDsKoichiro Den
The dmaengine core assigns channel IDs in registration order. If a driver skips a hardware channel, chan_id can differ from the hardware numbering and a client cannot reliably correlate a requested channel with hardware resources. Let a driver request an exact channel ID before device registration. Reserve static IDs through the existing IDA so they remain unique, while retaining automatic IDA allocation as the default. For example, idma32 uses chan_id to select DMA_CTL_CH() and DMA_XBAR_SEL(), so it relies on ascending registration order to match chan_id with the hardware channel number. Use direction-flattened IDs for dw-edma channels. Unlike the direction-local hardware channel number, these IDs are unique within the DMA device. Suggested-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Koichiro Den <den@valinux.co.jp> Link: https://lore.kernel.org/r/lm7tadnxsyrypu4mypptlkx5qkytex4qxsijdr5ydud2n3anvf@yakjfjg5ng4u/ Link: https://lore.kernel.org/r/20260813063757.3131865-2-den@valinux.co.jp/ Link: https://lore.kernel.org/r/an4TXwT37vWYEzCn@SMW015318/ Link: https://patch.msgid.link/20260912174023.1227397-2-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>
11 daysdt-bindings: dma: Add Amlogic A9 SoC DMAXianwei Zhao
Add documentation describing the Amlogic A9 SoC DMA. And add the properties specific values defines into a new include file. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Link: https://patch.msgid.link/20260903-amlogic-dma-v12-1-f769bc344056@amlogic.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
11 daysNFSv4/pnfs: Recover revoked layouts on a deleted deviceIDBenjamin Coddington
RFC 8881 Section 20.12 lets a server send CB_NOTIFY_DEVICEID DELETE for a deviceID once it has revoked every layout referring to it. Revocation is not announced, so the client can still be holding what it believes are live layouts on that deviceID. Section 18.40.4 resolves that: TEST_STATEID each referring layout and recover the ones that come back revoked -- mark the layout stateid invalid, free the lsegs, FREE_STATEID to acknowledge. The callback thread cannot issue fore-channel RPCs, so suspects are queued on the nfs_client (dedup'd, holding a layoutdriver reference) and resolved by a new state-manager step keyed on NFS4CLNT_DEVICEID_DELETE. The worker re-collects the referring layouts, so layouts returned or recalled in the meantime are skipped. Drop the cached device once the collected layouts account for the delete: every one of them was revoked here. Section 18.48.3 defines TEST_STATEID's answers, and NFS4ERR_OLD_STATEID says the layout exists and was not revoked -- only that it moved on after this stateid was snapshotted -- so it counts against the delete as NFS4_OK does. Any other answer leaves the revocation unresolved and keeps the device cached, as does a layout the server still considers valid (verifying that one with GETDEVICEINFO comes next). A layout counts as revoked only if it was invalidated here; a stateid that no longer matches its layout is a stale snapshot. Invalidating one is paired with nfs_commit_inode(), since pnfs_clear_lseg_state() drops only the VALID and LAYOUTCOMMIT references, and an lseg still held by a commit bucket would keep the layout -- and the device nodes this recovery is trying to release -- alive. If the walk collects no referring layouts, the device is unreferenced and the delete is carried out directly. If the collection could not be completed, recovery leaves the device cached for the next notification. Nothing enqueues suspects yet, so no behavior change. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 dayspNFS: Discard a GETDEVICEINFO reply that raced a CHANGE notificationBenjamin Coddington
RFC 8881 Section 18.40.4: a GETDEVICEINFO reply in flight while the server changes the device mapping may carry the pre-change mapping; if it is inserted into the cache after the CHANGE notification unhashed the stale entry, the client re-caches stale data. Track a change epoch, bumped when a CHANGE notification is processed before the stale entry is unhashed. nfs4_find_get_deviceid() snapshots the epoch before issuing GETDEVICEINFO and, serialized against the unhash by nfs4_deviceid_lock at insert time, discards the reply and refetches if the epoch moved. A stale insert that instead precedes the unhash is removed by the unhash itself, so the cache does not retain the pre-change entry either way; a reference already handed to a caller in that ordering is dropped by the re-resolve walk instead. The refetch is bounded. The epoch is bumped once per CHANGE entry -- that is, at a rate the server chooses -- so an unbounded retry would let a server drive GETDEVICEINFO traffic without limit, and each discarded node can carry a DS client teardown and reconnect with it. After NFS4_DEVICEID_FETCH_RETRIES attempts the reply is accepted. That is safe because discarding is an optimisation rather than a correctness requirement: it avoids caching a mapping already known to be superseded, but before this patch the client cached whatever the reply carried, so the bounded case is no worse than the previous behaviour and a mapping that really is stale is corrected by the notification that follows. The epoch lives on the nfs_client, so a CHANGE delivered on one server's callback channel does not force an unrelated server's in-flight lookup to discard its reply and refetch. Mounts that share an nfs_client do share the counter; the deviceid cache is keyed per client ID, so that is the granularity the race is defined at. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 daysNFSv4/flexfiles: Carry the device node reference across each I/OBenjamin Coddington
Rather than dropping the device node reference when DS setup completes, transfer it to the in-flight I/O: carry it on nfs_pgio_header and nfs_commit_data as ds_dev, and release it when the header or commit data is released, alongside the lseg reference. Convert the completion paths to use the carried node instead of re-reading the mirror's pinned pointer: DS error tracking, marking the deviceid available/unavailable, and deleting the deviceid on connection errors now act on the node the I/O was actually sent to. Once a CHANGE notification can re-point the pinned pointer mid-flight, this keeps error attribution on the old device rather than its replacement (and removes a NULL dereference had the pointer been reset to NULL). FF_LAYOUT_DEVID_NODE() is now unused; remove it. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 daysNFSv4.1/pnfs: remember when a server needs a larger LAYOUTGET reply bufferBenjamin Coddington
When a LAYOUTGET only succeeds after escalating the reply buffer, every layout fetched from that server is likely to need the larger buffer: remember the escalated size on the nfs_server and use it as the floor for subsequent LAYOUTGET reply buffers, skipping the doomed attempt at the layout driver's default size. This also lets the LAYOUTGET attached to OPEN benefit: the lgopen path is best-effort with no retry of its own, so without the learned size it would fail with NFS4ERR_TOOSMALL at every open against a server handing out wide layouts, and layouts would only ever be acquired by the I/O path's retry. The field is a hint: reads and writes are racy by design, the value only ever grows toward the session's maximum response size, and a stale-low read merely costs one escalation round trip. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 daysnfs: introduce nfs_release_request_list helperPranjal Shrivastava
Introduce a centralized helper, nfs_release_request_list, to handle the bulk release of nfs_page requests from a list. This serves as a preparatory step for two upcoming improvements: 1. Pin-Aware Cleanup: As we migrate to iov_iter_extract_* API, requests will hold pins (GUP) instead of standard references. The helper ensures that the correct unpinning logic gets applied consistently across all requests in a list. 2. Folio Support: In subsequent patches where nfs_page structures will cover multi-page folios, this helper provides a clean infrastructure to unlock these larger units of I/O in bulk during completion, similar to the pattern in bio_release_pages. Additionally, refactor nfs_read_sync_pgio_error() to utilize this new helper. Signed-off-by: Pranjal Shrivastava <praan@google.com> Reviewed-by: Shivaji Kant <shivajikant@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 daysnfs: track number of pinned pages in nfs_pagePranjal Shrivastava
Track the number of pinned pages in nfs_page to handle unpinning correctly, ensuring that only primary requests perform the final unpinning operation, preventing subrequests from incorrectly performing unpinning on behalf of their parent requests. Add wb_nr_pinned to struct nfs_page to store the count of pinned pages owned by the request. Update request creation and cleanup helpers to initialize and use wb_nr_pinned for primary requests. Use the nfs_page_array_len() helper to calculate the number of pages spanned by a request's offset and length. Signed-off-by: Pranjal Shrivastava <praan@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 daysnfs: make nfs_page pin-awarePranjal Shrivastava
Modernizing the NFS Direct I/O path to use iov_iter_extract_pages() introduces page pinning (GUP) instead of standard page referencing. To handle this correctly, nfs_page must track whether it holds a pin or a standard reference. Introduce a new flag, PG_PINNED, to struct nfs_page. Update the creation path (nfs_page_create_from_page and nfs_page_create_from_folio) to accept a pinned bool and set the flag accordingly. If the page is pinned, we skip the existing reference increment (get_page/folio_get) as the pin itself acts as a reference. Update nfs_clear_request() & nfs_direct_release_pages() to use unpin_user_page() or unpin_user_folio() instead of only refcount decrement (put_page) when PG_PINNED flag is set. Finally, ensure subrequests inherit the pinning status from their parent request. Signed-off-by: Pranjal Shrivastava <praan@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
11 dayswifi: ieee80211: add NAN service ID list attribute definitionsIlan Peer
Add the Service ID List and Subscribe Service ID List NAN attribute IDs. These are needed to filter in NAN beacons during Instant Communication. Assisted-by: GitHubCopilot:claude-opus-5 Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20261005084458.3666739-8-ilan.peer@intel.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 dayswifi: cfg80211: do not use NAN beacons to update the BSS tableIlan Peer
As NAN beacons have a different structure compared to beacons defined in the IEEE802.11 specification, e.g., they do not contain a SSID element etc., they cannot be used to update the BSS table. Add a utility function to check if a frame is a NAN beacon and use it do return early in cfg80211_inform_bss_frame_data(). Signed-off-by: Ilan Peer <ilan.peer@intel.com> Link: https://patch.msgid.link/20261005084458.3666739-5-ilan.peer@intel.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 dayswifi: cfg80211: nan: add Instant Communication supportIlan Peer
Add NL80211_NAN_CONF_INSTANT_COMM flag to let user space request that the NAN synchronization logic starts Instant Communication (IC) as defined in Chapter 13 of the Wi-Fi Aware Specification v4.0. Add NL80211_NAN_CAPA_INSTANT_COMM for drivers to advertise it. The capability requires configurable synchronization support, and IC requests are rejected if it isn't advertised. When IC is enabled, user space must also configure the discovery beacon interval. The IC schedule is expected to be configured by user space. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20261005084458.3666739-2-ilan.peer@intel.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>