summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
11 dayswifi: mac80211: fix and clean up protected TWT supportJohannes Berg
The "twt_protected" flag in the link/bss_conf information really isn't right since this is negotiated via RSNX and therefore cannot differ per link. Move it to be a per-STA indication and also derive it from the new assoc request flag since that gets used with security profile. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260930120021.844fde440b63.I80999965c70e50d756ab62833fc7f53f2481cf3d@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 dayswifi: cfg80211: add protected TWT assoc flagJohannes Berg
Protected TWT support is indicated in RSNX, but RSNX may be used from security profile now, and not be present in the association response frame, so the logic in mac80211 to determine it doesn't/won't really work. Add a flag for wpa_supplicant to indicate if protected TWT is supported in the association, it can easily check this based on the RSNX data that was used. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260930120021.1eb6760356f2.Ie4962eaca97be29c7f08043d615534c7aeb3f370@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 dayswifi: ieee80211: type-check (extended) element functionsJohannes Berg
Type-check element finding functions and element iteration macros, so that when constants are given for the (extended) ID they must be from the appropriate enum, otherwise an enum compare compiler warning will trigger. Two places are using element iteration for subelements, but don't have the outer element as a struct element, so they need casts to avoid the warning now, but overall this will flag issues like the one in the previous commit. Link: https://patch.msgid.link/20260928193832.706fb927f309.I0f8702dc218b56470017d2fcf8fff2980946e818@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 dayscoredump: replace the startup completion with a thread countChristian Brauner
coredump_wait() sets core_state->nr_threads to the number of tasks killed and waits for the last thread to enter coredump_task_exit() to signal completion. Let's just wait on the count directly. The exiting tasks can use atomic_dec_and_wake_up() and the dumping task sleeps in wait_var_event_state(). The dumping task must remain freezable since commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic"). So keep the wait TASK_UNINTERRUPTIBLE|TASK_FREEZABLE. Drop the completion and rename nr_threads to threads_remaining. No functional changes. Suggested-by: NeilBrown <neilb@ownmail.net> Link: https://lore.kernel.org/178899497961.207413.10554121774377911612@noble.neil.brown.name Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-12-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 dayssched: add wait_var_event_state()Christian Brauner
All wait_var_event() sleep in a fixed task state. For coredumps we need a variant that takes the state from the caller the way wait_event_state() does. This allows us to continue sleeping with TASK_FREEZABLE. That's certainly also a useful addition for other places. Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-11-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 dayscoredump: drop core_state->dumperChristian Brauner
The core_state->dumper field isn't used anymore. Only its ->next pointer is. The current task is always the dumping thread and the ->task pointer is never read. Replace it with a plain pointer to the list of parked threads. Historically, core_state->dumper was used. Its ->task pointer was read. by fill_note_info() started at &core_state->dumper to ensure that the dumping thread came first in the ELF thread notes. That changed in commit 4b0e21d64253 ("[elf][regset] simplify thread list handling in fill_note_info()"). The first iteration was taken out of the loop. So it's been unused ever since. No functional changes. Suggested-by: NeilBrown <neilb@ownmail.net> Link: https://lore.kernel.org/178900159210.207413.8292125177519817528@noble.neil.brown.name Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-10-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfs: rename do_close_on_exec() to close_cloexec_files()Christian Brauner
Rename the helper and align it with close_files(). No functional changes. Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-8-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfs: remove unshare_files()Christian Brauner
exec is the only caller left since commit 433967cab51e ("coredump: stop unsharing the file descriptor table"). All it does is call unshare_fd() with CLONE_FILES and install the copy. Kill the pointless helper and open-code it. No functional changes. Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-4-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfs: move unshare_fd() to fs/file.cChristian Brauner
Move unshare_fd() where the rest of the descriptor table lifecycle helpers live. No functional changes. Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-3-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfs: add switch_files_struct()Christian Brauner
Add switch_files_struct() to install another table on a task. It consumes the reference to the new table and puts the old one. Convert every place that switches a descriptor table except unshare_files(). No functional changes. Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-2-a5c1800dc930@kernel.org Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfile: add CLOSE_RANGE_CLOEXEC_ONLYChristian Brauner
CLOSE_RANGE_CLOEXEC marks a range close-on-exec. Nothing happens to these fds unless an exec happens. Add CLOSE_RANGE_CLOEXEC_ONLY which closes the close-on-exec file descriptors in the range. When combined with CLOSE_RANGE_EXCEPT it names the close-on-exec file descriptors that are supposed to survive. Every close-on-exec fd outside of the range is closed. File descriptors without that flag are left alone. Whatever the caller deliberately passes down, stdio, LISTEN_FDS, an inherited pipe, remains where it is. The handful of close-on-exec descriptors the caller still needs for the exec such as the executable, an error pipe, sit in a specific range. That is what a task between clone(CLONE_FILES) and execve() actually wants: clone(CLONE_FILES | CLONE_VM | CLONE_VFORK) child: close_range(lo, hi, CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC_ONLY | CLOSE_RANGE_EXCEPT) child: rearrange descriptors in the now private table child: execve() Between the clone and the close_range() the child holds no reference of its own on any file because copy_files() only bumps the fdtable refcount. So a close() in the parent takes effect immediately. The unshare also never takes a reference on the fds it leaves behind either. The range is expressed in the parent's numbering. So a caller that cannot name the file descriptors it keeps contiguously picks a range wide enough to cover them, unshares, and tidies up with a second close_range() on the table it now owns alone. That one is cheap. To keep nothing, name a range that cannot hold an open descriptor, e.g. close_range(~0U, ~0U, ...). CLOSE_RANGE_CLOEXEC and CLOSE_RANGE_CLOEXEC_ONLY are mutually exclusive. Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-9-c20d0b49270d@kernel.org Reviewed-by: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfile: let dup_fd() drop only close-on-exec descriptorsChristian Brauner
Add FD_RANGE_CLOEXEC_ONLY. When set dup_fd() leaves everything behind except for fds that are close-on-exec. Without FD_RANGE_EXCEPT the clone loses the close-on-exec descriptors in the range. With it the clone keeps the range and loses the close-on-exec descriptors everywhere else. Descriptors without the flag are carried over either way. Nothing passes the flag yet. Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-8-c20d0b49270d@kernel.org Reviewed-by: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfile: add CLOSE_RANGE_EXCEPTChristian Brauner
close_range() operates on [fd, max_fd]. Add CLOSE_RANGE_EXCEPT. This new flag instructs it to operate on all file descriptors outside of the range instead. Without any other flags that means it closes everything except the file descriptors in the specified range. Together with CLOSE_RANGE_CLOEXEC it marks every file descriptor except the ones in the range as close-on-exec. With CLOSE_RANGE_UNSHARE dup_fd() never takes a reference on what is dropped. 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: close_range(lo, hi, CLOSE_RANGE_UNSHARE | CLOSE_RANGE_EXCEPT) Nothing outside of the window is referenced by the child at any point. Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-6-c20d0b49270d@kernel.org Reviewed-by: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysclose_range: turn the flags into an enumChristian Brauner
Turn the close_range() flags into an enum. Makes debugging a lot easier. No functional changes. Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-5-c20d0b49270d@kernel.org Reviewed-by: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysfile: let dup_fd() drop everything outside of the rangeChristian Brauner
Add FD_RANGE_EXCEPT. It turns the meaning of range around. Instead of indicating that the descriptors in the range are the ones that are left out of the copy they indicate the range that makes it into the copy. All other files are left behind. The clone only has to reach the last open descriptor inside the range. Nothing passes the flag yet. Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-4-c20d0b49270d@kernel.org Reviewed-by: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
11 daysmedia: mc: Add INTERNAL pad flagSakari Ailus
Internal sink pads will be used as routing endpoints in V4L2 [GS]_ROUTING IOCTLs, to indicate that the stream begins in the entity. Internal sink pads are pads that have both SINK and INTERNAL flags set. Also prevent creating links to pads that have been flagged as internal and initialising SOURCE pads with INTERNAL flag set. Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Martin Hecht <mhecht73@gmail.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
11 daysAutomated merge of 'dev' into 'next'Paul Moore
* dev: audit: separate file and process capability storage audit: Fix filter rule accounting after automatic removal audit: use copied skb length in kauditd_send_multicast_skb() audit: add missing unlikely hint to audit_dummy_context() wrappers audit: free proctitle in context so it can be re-set by fork on exec_binprm
11 daysAutomated merge of 'topic-7.3-audit_fsopen' into 'next'Paul Moore
* topic-7.3-audit_fsopen: audit: add FSOPEN record to log filesystem name
11 daysdt-bindings: phy: Add nvidia,tegra264-mphyKartik Rajput
Add binding for the MIPI M-PHY on NVIDIA Tegra264 SoCs. The M-PHY is a hardware block with two lanes, l0 and l1, used by the Tegra264 UFS host controller. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260909-tegra264-mphy-v1-1-ce61a80dc065@nvidia.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
11 daysMerge remote-tracking branch 'linux-axboe/for-7.4/lazy-bounce-buffering' ↵Carlos Maiolino
into xfs-7.4-merge Merge linux-bounce-buffering onto xfs-7-4-merge Signed-off-by: Carlos Maiolino <cem@kernel.org>
11 daysMerge 7.3-rc6 into tty-nextGreg Kroah-Hartman
Resolves a bunch of merge conflicts with serial driver changes and we need the fixes in here for testing and future patches. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 daysMerge 7.3-rc6 into char-misc-nextGreg Kroah-Hartman
This resolves a number of merge conflicts between the branches, and we pick up the fixes in 7.3-rc6 that we need for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 dayssoc: qcom: geni-se: Drop unused icc_ddr parameter from geni_icc_get()Somesh Dey
geni_icc_get() takes an icc_ddr string argument but never uses it: the DDR interconnect path is looked up with the "qup-memory" string literal directly, and the sole caller passes that same literal. The parameter carries no information. Drop the icc_ddr parameter and update the prototype and call site accordingly. Signed-off-by: Somesh Dey <somesh.dey@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260930-icc-ddr-param-remove-v1-1-61223714c9bc@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
11 daysdt-bindings: arm: qcom,ids: Add SoC ID for SM8950Jingyi Wang
Add the ID for the Qualcomm SM8950 SoC which represents the Maili platform. Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260922-maili-socinfo-v1-1-a82bd7d4ca77@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
11 dayssoc: qcom: llcc: Add LLCC configuration for NordAnurag Pateriya
Add the sub-cache table for Nord, derived from the Nord AU (Safe IVI) SCT table and limited to the POR use cases that have a unique SCID and a usecase ID in llcc-qcom.h. Nord has the CFG0/CFG1 pairs and the full ALGO_ALLOC0..3 set, so it uses the v6 register offsets. num_banks is set explicitly because LLCC_LB_CNT in LLCC_COMMON_STATUS0 is four bits wide and cannot report sixteen banks; a wrong count makes the driver map a bank aperture in place of the broadcast region and abort on the first broadcast read. no_edac is set because the bootloader leaves the LLCC EDAC registers locked, as on Glymur. Signed-off-by: Anurag Pateriya <anurag.pateriya@oss.qualcomm.com> Tested-by: Zhangfei Gao <zhangfei.gao@oss.qualcomm.com> Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Reviewed-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260910-nord_llcc-v1-2-30fd1cca65fe@oss.qualcomm.com Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
11 daysdt-bindings: arm: qcom,ids: Add SoC ID for SM8975Mukesh Ojha
Add the ID for the Qualcomm SM8975 SoC which represents the Hawi platform. Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260923-hawi-socinfo-v1-1-f0d1aaee9323@oss.qualcomm.com Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
11 dayssoc: qcom: ubwc: Add configuration for HawiWangao Wang
Add UBWC configuration data for the Hawi platform, which uses UBWC 7.0 and enables the required flags and highest bank bit settings. This allows drivers to query the correct UBWC capabilities on Hawi. Also add UBWC 7.0 support to the version tag helper so that qcom_ubwc_version_tag() returns the correct tag for UBWC 7.0. Signed-off-by: Wangao Wang <wangao.wang@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260812-ubwc_for_hawi_maili-v1-1-c29edecb3bd8@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
11 daysdt-bindings: arm: qcom,ids: Add SoC ID for SM7250Sreeshankar K
Add the ID for the Qualcomm SM7250 SoC. Signed-off-by: Sreeshankar K <sreeshankar0910@gmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260824150156.1310-2-sreeshankar0910@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
11 daysMerge 7.3-rc6 into usb-nextGreg Kroah-Hartman
We need the usb/thunderbolt fixes in here to work off of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 dayssvcrdma: Fix svc_rdma_recv_cid_init() kernel-docKarl Mehltretter
svc_rdma_recv_cid_init() initializes a Receive Queue completion ID, but its kernel-doc heading names svc_rdma_send_cid_init(). The latter is a separate helper immediately below it, so kernel-doc cannot match this comment to the receive helper. Fix the copied function name. Fixes: 28ee0ec8948a ("svcrdma: De-duplicate completion ID initialization helpers") Assisted-by: LLM Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Link: https://patch.msgid.link/20260909064343.90437-1-kmehltretter@gmail.com Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysxdrgen: Stream optional-data aggregate lists during encodeChuck Lever
The optional-data aggregate encoder loops cursor.count times, so the begin hook must report the element count before the first element is written. A producer that reads its elements while the reply is encoded -- NFSv2 READDIR streaming directory entries straight into the send buffer -- does not know that count in advance, and would have to materialize the whole list just to satisfy the loop bound. An optional-data list carries no count on the wire, so nothing forces one on the encoder. Drive it from the item hook instead: a false return ends the list, and the framing writes the terminator. The counted-array form and its hook contract are unchanged. No in-tree spec marks an optional-data member yet, so no generated code changes here. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-11-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysxdrgen: Add hook-driven aggregate codec for variable-length arraysChuck Lever
A generated variable-length array codec stages the wire array as a C array and walks it. When the in-kernel object is not that array, building that array is wasted memory traffic. The NFS_ACLv2 secattr aclent<> list is one such case: it is a Solaris wire form of the kernel's posix_acl. The hand-rolled codec that performs that transform forces its containing types to keep external linkage (pragma public), and that linkage collides at link time with the same generated types in a sibling program. Add a per-member "pragma aggregate <struct> <member>" directive. For a marked member the generated code owns only the wire framing and calls hand-written begin, item, and end hooks that handle one element at a time. Interior codec signatures do not change. The framing-owned loop follows xdr_encode_array2(), whose only remaining user is fs/nfs_common/nfsacl.c, and seq_file's start/show/stop, where a guaranteed stop() releases what start() took. Those APIs take an ops vtable because one loop serves consumers chosen at run time. Here the consumer is known at generation time, so the hooks bind by name at link time, as the ASN.1 compiler's actions do. A missing hook is a link error, the emitted prototypes enforce the element type, and no indirect call is added per element. The item hooks return only success or failure, with no early "no more elements" return, so that the same hook contract can later frame the RFC 4506 optional-data idiom, where the application pushes entries into generated framing. The front end resolves each marker against the specification and reports one it cannot honor against its own source position, rather than degrading silently to the array-walking codec or surfacing as a traceback from whichever emitter reached it. Absent the marker the generator emits byte-identical output. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-9-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysxdrgen: Extend the pages directive to page-resident argumentsChuck Lever
The pages directive so far drives only the encoder. A bulk argument such as the payload of an NFS WRITE arrives in the pages of the server's Receive buffer, but the generated opaque decoder copies it into a contiguous data pointer. The copy wastes memory bandwidth and forces the containing procedure decoder to be hand-rolled. Let the directive drive the decoder as well. Whether a marked member is decoded in place or encoded by reference follows from whether its containing type is reachable from an RPC procedure argument. Record that set during parsing, then close it over nested aggregates and typedef aliases before the directives are checked. A decoded page-resident member is represented as a struct xdr_buf so that the payload can be handed on without a copy. A marked union arm of an argument type is rejected, since the union generator still emits only the copying decoder. A marked type reachable from both an argument and a result is rejected as well: the two representations differ, and a type carries only one. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-8-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: Add svcxdr_decode_opaque_payload()Chuck Lever
A bulk argument payload such as the content of an NFS WRITE request arrives in the pages of the server's Receive buffer. Copying it into a contiguous data pointer wastes memory bandwidth and defeats a transport capable of direct data placement, so a server decodes such an item in place: it reads the length prefix and captures the payload octets by reference in an xdr_buf that later stages hand to the VFS. svcxdr_encode_opaque_payload() already provides the encode-side counterpart for a page-resident result payload. Add the decode-side helper so a generated decoder can express the same in-place handling for a page-resident argument. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-7-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: Add svcxdr_encode_opaque_payload()Chuck Lever
The encoder functions that xdrgen emits handle a variable-length opaque with xdr_stream_encode_opaque(), which copies the opaque content into the RPC buffer. On the server, an NFS READ payload already resides in the pages of rqstp->rq_res, placed there by an underlying file system read. Copying that payload into the RPC Reply buffer adds a data copy on every READ and prevents a transport capable of direct data placement from conveying the payload separately from the rest of the Reply. Add a helper that encodes a page-resident opaque by reference: it encodes the length, inserts the payload pages into the XDR stream, then marks the byte range as a result payload. Generated code calls this helper, so its parameters are limited to the xdr_stream and the payload length. It recovers the svc_rqst with svcxdr_rqst(), and takes the reply's page array from the stream's buffer. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-4-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: Bind the svc_rqst to its XDR streamsChuck Lever
A generated XDR codec function receives only an xdr_stream, but some codecs need the RPC transaction the stream belongs to: to reach the procedure's argument and result structures, or to mark a page-resident byte range as a result payload. A client stream already records its transaction in the rqst field; a server stream records nothing, so each generated codec that needs the svc_rqst would have to store it in xdrgen_ctx itself, and every such site would decide on its own what the pointer means. Store the svc_rqst in xdrgen_ctx from svcxdr_init_decode() and svcxdr_init_encode() instead, and read it back through svcxdr_rqst() so that no codec open-codes the cast from void *. A codec running on a stream either of those initialized reaches the transaction, and through it rq_argp and rq_resp. Every other initializer leaves xdrgen_ctx NULL, so svcxdr_rqst() returns NULL there and the guarantee is scoped to those two entry points; a codec that needs the svc_rqst names them in its Context: line. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260908134234.512312-3-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: Carry a generated-codec context pointer in struct xdr_streamChuck Lever
A generated XDR codec function receives only an xdr_stream, yet some codecs need state that the stream does not carry. Passing that state as an additional argument changes the signature of every function on the path from the program entry point down to the one that consumes it, and for generated code it makes each function's argument list depend on an analysis of the entire specification. Add xdrgen_ctx to struct xdr_stream, a pointer that the layer initializing the stream sets aside for generated codecs to find, following the precedent of seq_file->private and netlink_callback->data. Every xdr_stream initializer clears it, so a codec never reads a residual value left in a stream that was allocated on the stack or taken from a transport's free pool. Acked-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: NeilBrown <neil@brown.name> Link: https://patch.msgid.link/20260908134234.512312-2-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: report local rpcbind calls that get no answerJeff Layton
A caller that creates many listeners in one operation calls svc_register() once for each of them. Every call waits for the local rpcbind on its own, so a rpcbind that never answers costs the caller one timeout per listener. The caller has no way to learn that the first call already failed. Split rpcb_register_call() failures by whether rpcbind answered: - answered: a FALSE reply, or an RPC-level rejection that rpc_decode_header() derives from the reply. -EACCES (FALSE reply or AUTH_ERROR), -EPROTONOSUPPORT, -EPFNOSUPPORT, -EOPNOTSUPP. - never sent: -ENOMEM, -EMSGSIZE, -ERESTARTSYS. - no answer: everything else, i.e. transport errors. Any no-answer error gets represented by -EIO, which is already what the RPC layer reports for most of it: rpc_check_timeout() returns -EIO for a soft timeout without RPC_TASK_TIMEOUT, and call_status() documents -EIO as "shutdown or soft timeout". Keep a count of the number of rpcbind failures in the serv. Later patches will use that to watch for hard rpcbind failures, and alter their behavior accordingly. Assisted-by: LLM Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260901-nfsd-nl-hang-v5-6-a540d86668b0@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysSUNRPC: Skip xpt_reserved accounting for non-UDP transportsChuck Lever
The xpt_reserved counter exists for UDP socket-buffer back-pressure. svc_udp_has_wspace() is the only has_wspace implementation that consults it, so on TCP and RDMA the counter is maintained and never read. svc_handle_xprt() adds to it once per RPC. svc_reserve() shrinks it again on each call from svc_process_common(), from svc_xprt_release(), and from each proc function that calls svc_reserve_auth(). Every shrinking call also runs svc_xprt_resource_released(), which issues an smp_mb() and can enqueue the transport. Add an xcl_flags field to svc_xprt_class and set SVC_XPRT_FLAG_WSPACE_RESERVE on the UDP class. Gate the xpt_reserved accounting on that flag. After the change, svc_reserve() no longer calls svc_xprt_resource_released() on TCP and RDMA. Two paths still cover that enqueue. svc_xprt_release() reaches the helper through svc_xprt_release_slot(), and svc_xprt_received() enqueues a transport whose XPT_DATA remains set. Link: https://patch.msgid.link/20260828135036.796842-4-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Replace the use of include/trace/misc/nfs.hChuck Lever
fs/nfsd/trace.h includes include/trace/misc/nfs.h for show_nfs4_seq4_status() and show_rca_mask(). That header pulls in linux/nfs.h, so every NFSD translation unit that reads trace.h also sees the NFS_OK, NFSERR_*, and file-type enumerators. I'm about to switch fs/nfsd/nfserr.h to an xdrgen-generated header, which defines enum nfsstat and enum ftype with those same names. Any translation unit that includes both headers then fails to build with enumerator redefinition errors. To address this, stop including trace/misc/nfs.h in fs/nfsd/trace.h. Link: https://patch.msgid.link/20260827185134.197322-1-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFS: Import NFS3ERR definitionsChuck Lever
enum nfs_stat in uapi/linux/nfs.h collects the on-the-wire status codes for every NFS version under version-agnostic NFSERR_* names. The in-kernel NFS client and server reference these names internally, which drags uapi/linux/nfs.h into many translation units that need nothing else from that header. xdrgen conversion will provide spec-based definitions of the NFS status enum constants. Replacing the existing internal references with version-specific names requires a version-specific spelling for each code that NFSD uses. linux/nfs4.h already supplies the NFSv4 codes, but NFSv3 has no counterpart header, and not every NFSv3 code has an NFS4ERR_* spelling: NFSERR_NOT_SYNC (10002) and NFSERR_REMOTE (71) have no NFSv4 equivalent at all, and NFSERR_JUKEBOX (10008) appears in NFSv4 as NFS4ERR_DELAY. Introduce the NFSv3 status codes as NFS3ERR_* in linux/nfs3.h so a subsequent patch can respell NFSD's status definitions without relying on uapi/linux/nfs.h. Reviewed-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260826194444.148243-1-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Resolve the recall-any mask names in the trace formatChuck Lever
RCA4_TYPE_MASK_* are enum constants, so the preprocessor cannot fold them into the print format that show_rca_mask() builds for the nfsd_cb_recall_any event. Nothing declares an eval map for them either, so trace_event_eval_update() has no substitution to apply at module load, and the event's format file ships the enumerator names verbatim. trace-cmd and perf cannot decode the bmval0 field. Declare the eval maps for the nine mask bits show_rca_mask() decodes. The format then carries the shift counts as integers, the same shape the SUNRPC trace points already emit from their BIT() flag decoders. Fixes: 638593be55c0 ("NFSD: add CB_RECALL_ANY tracepoints") Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260818184151.31180-1-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysnfs_common: Remove "#include <linux/nfs.h>" from linux/nfslocalio.hChuck Lever
Clean up: linux/nfslocalio.h pulls in linux/nfs.h only for the definition of struct nfs_fh, which now lives in linux/nfs_fh.h. Replace linux/nfs.h with linux/nfs_fh.h so that nfslocalio.h no longer carries uapi/linux/nfs.h into its consumers. Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Mike Snitzer <snitzer@kernel.org> Link: https://patch.msgid.link/20260728165911.462534-3-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Move the RPC program definition for LOCALIOChuck Lever
Clean up: The definitions for the LOCALIO program are not needed by most files that include linux/nfs.h. Following the convention used by most other in-kernel RPC program implementations, relocate the LOCALIO program definitions to a localio-specific header. Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Mike Snitzer <snitzer@kernel.org> Link: https://patch.msgid.link/20260728165911.462534-2-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Replace nfsd_write()'s "stable" argument with "iocb_flags"Chuck Lever
The current nfsd_write() API is not NFS version-agnostic, as it relies on callers to pass an NFSv3 stable_how value to determine the persistence of the requested WRITE. NFSv2 does not use a stable-how value on the wire, and NFSv4 has its own stable_how4 (though stable_how and stable_how4 happen to share the same numeric values). To remove the dependence on NFSv3-specific XDR values from NFSD's generic VFS APIs, replace nfsd_write()'s stable argument with an argument that passes a set of IOCB flags instead of an XDR-defined value. The NFSv4 WRITE and COPY paths had been borrowing the NFSv3 stable_how constants for their own on-the-wire stable values, relying on the numeric coincidence noted above. Convert those sites to the stable_how4 enumerators so the v4 code expresses its own protocol's values directly, with no change in behavior. While here, bound-check the decoded NFSv3 WRITE stable value, as the NFSv4 WRITE decoder already does, and make the nfsd3_writeargs stable field unsigned to suit. The larger benefit is one less NFSv4 dependency on nfs3.h. Link: https://patch.msgid.link/20260723182043.990391-3-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFS: Move definition of enum nfs3_stable_howChuck Lever
Clean up: enum nfs3_stable_how was introduced in NFSv3. NFSv2 has no stable_how on the wire; its write path passes NFS_FILE_SYNC only as a placeholder that the protocol ignores. The stable_how constants describe an NFSv3 wire value, so they belong in linux/nfs3.h. Link: https://patch.msgid.link/20260723182043.990391-2-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Split linux/nfs_ssc.hChuck Lever
The nfs_ssc.h header contains both client- and server-side data structures, which means each of those implementations has to pull in headers from the other. Create a linux/nfsd_ssc.h for the server side APIs which no longer includes uapi/linux/nfs.h either directly or indirectly. Because nfsd_ssc.h drops the transitive include of the NFS client headers, fs/nfsd/nfs4proc.c now includes <linux/pagemap.h> directly for filemap_check_wb_err(). struct nfsd4_ssc_umount_item is private to nfsd. Move it into fs/nfsd/xdr4.h alongside its only consumers rather than into the exported nfsd_ssc.h. As an added clean-up, add missing header guard macros and the struct file and struct vfsmount forward declarations the server prototypes need. Cc: Olga Kornievskaia <okorniev@redhat.com> Cc: Dai Ngo <dai.ngo@oracle.com> Link: https://patch.msgid.link/20260721162306.894558-5-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysnfs_common: Synchronize access to the SSC client ops tableChuck Lever
nfsd42_ssc_open() and nfsd42_ssc_close() load ssc_nfs4_ops without synchronization while nfs42_ssc_register() and nfs42_ssc_unregister() store to it. Those reads are safe today only through a non-obvious invariant: an inter-server copy holds an active vers=4.2 mount of the source across both calls, the mount pins the nfsv4 module through the nfs_client's cl_nfs_mod reference, and unregister runs only at nfsv4 module exit, so it cannot run while a call is in flight. Replace that implicit contract with synchronization local to the broker, so its safety no longer rests on a caller in another subsystem. Read the pointer under RCU so a reader observes it atomically as a valid table or NULL. nfs42_ssc_unregister() stores NULL and then calls synchronize_rcu(), so it cannot return while a reader still holds the pointer. The two readers need different handling because one sleeps and the other does not. sco_close() does not sleep, so nfsd42_ssc_close() runs it to completion inside the RCU read-side section and the synchronize_rcu() in unregister waits for it. __nfs42_ssc_open() does sleep -- it issues a GETATTR RPC to the source server and allocates with GFP_KERNEL -- so it must not run inside an RCU read-side section. Pin the provider module with try_module_get() while still under rcu_read_lock(), drop the lock, invoke the open, then release the module. The reference keeps the provider mapped across the sleep without relying on the caller's mount. If the table has already been torn down the copy gets -EIO. Cc: Olga Kornievskaia <okorniev@redhat.com> Cc: Dai Ngo <dai.ngo@oracle.com> Link: https://patch.msgid.link/20260721162306.894558-4-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysNFSD: Hoist nfs42_ssc_open() into fs/nfs_common/nfs_ssc.cChuck Lever
Refactor: The infrastructure and details for calling the client's ssc_open method can be hidden in nfs_ssc.c. This reduces the SSC footprint in fs/nfsd/nfs4proc.c, a step toward removing that file's dependency on <linux/nfs_fs.h>, which indirectly includes <uapi/linux/nfs.h>. The open and close functions are named "nfsd42_" since they are meant to be invoked only by NFSD. Cc: Olga Kornievskaia <okorniev@redhat.com> Cc: Dai Ngo <dai.ngo@oracle.com> Link: https://patch.msgid.link/20260721162306.894558-3-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
11 daysnfs_common: Remove unused nfs_ssc_client_ops infrastructureChuck Lever
Clean up: Commit 75333d48f922 ("NFSD: fix use-after-free in __nfs42_ssc_open()") addressed a use-after-free bug by removing the nfsd4_interssc_disconnect() function. Post-copy clean-up was then delegated to NFSD's laundromat. Since that commit, the nfs_do_sb_deactive() wrapper function and the entire nfs_ssc_client_ops infrastructure no longer have any consumers. This includes nfs_do_sb_deactive(), struct nfs_ssc_client_ops, nfs_ssc_register(), nfs_ssc_unregister(), and related registrations in the NFS client. Cc: Olga Kornievskaia <okorniev@redhat.com> Cc: Dai Ngo <dai.ngo@oracle.com> Link: https://patch.msgid.link/20260721162306.894558-2-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>