Re: [PATCH v13 15/19] pnfs/flexfiles: enable localio support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 24 Aug 2024, Mike Snitzer wrote:
> From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> 
> If the DS is local to this client use localio to write the data.
> 
> Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
> ---
>  fs/nfs/flexfilelayout/flexfilelayout.c    | 136 +++++++++++++++++++++-
>  fs/nfs/flexfilelayout/flexfilelayout.h    |   2 +
>  fs/nfs/flexfilelayout/flexfilelayoutdev.c |   6 +
>  3 files changed, 140 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
> index 01ee52551a63..d91b640f6c05 100644
> --- a/fs/nfs/flexfilelayout/flexfilelayout.c
> +++ b/fs/nfs/flexfilelayout/flexfilelayout.c
> @@ -11,6 +11,7 @@
>  #include <linux/nfs_mount.h>
>  #include <linux/nfs_page.h>
>  #include <linux/module.h>
> +#include <linux/file.h>
>  #include <linux/sched/mm.h>
>  
>  #include <linux/sunrpc/metrics.h>
> @@ -162,6 +163,72 @@ decode_name(struct xdr_stream *xdr, u32 *id)
>  	return 0;
>  }
>  
> +/*
> + * A dummy definition to make RCU (and non-LOCALIO compilation) happy.
> + * struct nfsd_file should never be dereferenced in this file.
> + */
> +struct nfsd_file {
> +       int undefined__;
> +};

I removed this and tried building both with and without LOCALIO enabled
and the compiler didn't complain.
Could you tell me what to do to see the unhappiness you mention?


> diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
> index f84b3fb0dddd..562e7e27a8b5 100644
> --- a/fs/nfs/flexfilelayout/flexfilelayout.h
> +++ b/fs/nfs/flexfilelayout/flexfilelayout.h
> @@ -82,7 +82,9 @@ struct nfs4_ff_layout_mirror {
>  	struct nfs_fh			*fh_versions;
>  	nfs4_stateid			stateid;
>  	const struct cred __rcu		*ro_cred;
> +	struct nfsd_file __rcu		*ro_file;
>  	const struct cred __rcu		*rw_cred;
> +	struct nfsd_file __rcu		*rw_file;

What is the lifetime of a layout_mirror?  Does it live for longer than a
single IO request?  If so we have a problem as this will pin the
nfsd_file until the layout is returned.


Thanks,
NeilBrown





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux