Re: [PATCH 2/6] NFSD: Apply per-export I/O modes to READ and WRITE
From: Chuck Lever
Date: Tue Oct 27 2026 - 15:43:48 EST
On Tue, Oct 27, 2026, at 1:59 PM, Jeff Layton wrote:
> On Tue, 2026-10-27 at 13:54 -0400, Chuck Lever wrote:
>> On 10/27/26 12:45 PM, Jeff Layton wrote:
>> > Resolve each export's effective I/O mode (explicit setting, else the
>> > global io_cache_read/write knob) in nfsd_iter_read and nfsd_vfs_write,
>> > and skip splice for reads on exports whose effective read mode is not
>> > buffered. Update the debugfs knob comments to match.
>>
>> [ ... ]
>>
>> > - if (file->f_op->splice_read && nfsd_read_splice_ok(rqstp))
>> > + if (file->f_op->splice_read && nfsd_read_splice_ok(rqstp) &&
>> > + nfsd_read_iomode(fhp->fh_export) == NFSD_IO_BUFFERED)
>> > err = nfsd_splice_read(rqstp, fhp, file, offset, count, eof);
>>
>> nfsd_io_cache_read_set() still sets nfsd_disable_splice_read whenever
>> the global knob is switched to dontcache or direct, so
>> nfsd_read_splice_ok() returns false before this per-export test is
>> reached. An export pinned to riomode=buffered on such a server never
>> gets splice; it falls through to nfsd_iter_read() and does vector
>> buffered reads. The same applies to the splice_ok decisions in
>> nfsd4_encode_read() and nfsd4_encode_read_plus_data().
>>
>> Patch 3/6 says an explicit per-export setting pins that export's
>> IO mode "regardless of the global knob", and that isn't quite true
>> now for the buffered case.
>>
>> I need to think carefully about the interaction between the "disable
>> splice" setting, which is global, and the per-export I/O setting.
>>
>
> Maybe disable_splice should be an export option of its own? It seems
> like that should be doable.
That would be easy to implement, but I wonder if it's something we want
to carry as a permanent extension of the export options API.
--
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)