Re: [PATCH 2/2] NFSv4: Allow per-mount tuning of READDIR attrs
From: Chuck Lever <chuck.lever@oracle.com>
Date: 2023-10-18 14:35:28
On Wed, Oct 18, 2023 at 10:24:18AM -0400, Benjamin Coddington wrote:
On 18 Oct 2023, at 9:33, Jeff Layton wrote:quoted
On Wed, 2023-10-18 at 08:56 -0400, Chuck Lever wrote:quoted
On Tue, Oct 17, 2023 at 05:30:44PM -0400, Benjamin Coddington wrote:quoted
Expose a per-mount knob in sysfs to set the READDIR requested attributes for a non-plus READDIR request. For example: echo 0x800 0x800000 0x0 > /sys/fs/nfs/0\:57/v4_readdir_attrs .. will revert the client to only request rdattr_error and mounted_on_fileid for any non "plus" READDIR, as before the patch preceeding this one in this series. This provides existing installations an option to fix a potential performance regression that may occur after NFS clients update to request additional default READDIR attributes. Signed-off-by: Benjamin Coddington <redacted> --- fs/nfs/client.c | 2 + fs/nfs/nfs4client.c | 4 ++ fs/nfs/nfs4proc.c | 1 + fs/nfs/nfs4xdr.c | 7 ++-- fs/nfs/sysfs.c | 81 +++++++++++++++++++++++++++++++++++++++ include/linux/nfs_fs_sb.h | 1 + include/linux/nfs_xdr.h | 1 + 7 files changed, 93 insertions(+), 4 deletions(-)Admittedly, it would be much easier for humans to use if the API was based on the symbolic names of the bits rather than a triplet of raw hexadecimal values.This isn't aiming to be an ease-of-use interface. This is tinkering with the innards of the client. If you're doing this, you better know how to convert between bases, because you're going to need that and more. If we want to make it nice, patches to nfsctl can follow.
I don't see a reason this shouldn't be easier to use, especially since mistakes in setting these bits have consequences. There are currently 82 of them, after all. But, OK, the polish can be applied by a user space tool. -- Chuck Lever