When encoding a filehandle for a CB_NOTIFY, there is no svc_export
available, but the server needs to know whether to encode a connectable
filehandle. Add a flag to the nfs4_file that tells whether the
svc_export under which a directory delegation was acquired requires
connectable filehandles.

Signed-off-by: Jeff Layton <[email protected]>
---
 fs/nfsd/nfs4state.c | 1 +
 fs/nfsd/state.h     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 
2147b5f80ca0e650e9dbdb63de7c9af6f4bc7bff..9b5f559ff6125a551f73ac103f8af2e3763dc3e6
 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5031,6 +5031,7 @@ static void nfsd4_file_init(const struct svc_fh *fh, 
struct nfs4_file *fp)
        memset(fp->fi_access, 0, sizeof(fp->fi_access));
        fp->fi_aliased = false;
        fp->fi_inode = d_inode(fh->fh_dentry);
+       fp->fi_connectable = fh->fh_export->ex_flags & EXPORT_FH_CONNECTABLE;
 #ifdef CONFIG_NFSD_PNFS
        INIT_LIST_HEAD(&fp->fi_lo_states);
        atomic_set(&fp->fi_lo_recalls, 0);
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 
232b64e1d7721d3074364ff788b4f72b02a6c63f..6e066f0721e6a48394e182b3c273a44d2fbb652d
 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -730,6 +730,7 @@ struct nfs4_file {
        int                     fi_delegees;
        struct knfsd_fh         fi_fhandle;
        bool                    fi_had_conflict;
+       bool                    fi_connectable;
 #ifdef CONFIG_NFSD_PNFS
        struct list_head        fi_lo_states;
        atomic_t                fi_lo_recalls;

-- 
2.51.0


Reply via email to