[PATCH/RFC] Hard code testing on server <ONLY FOR TESTING>

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

 



This should only be used for testing volatile file handle support

Force STALE errors to be FHEXPIRED and have server say it uses FH_VOLATILE_ANY. 

To force an expired change the fsid to 0 from another value in /etc/exports on
the server and then restart the server. This would normally force all the
handles to be stale, which forces FHEXPIRED to be returned for all putfh
operations.

Signed-off-by: Matthew Treinish <treinish@xxxxxxxxxxxxxxxxxx>

---
 fs/nfsd/nfs4xdr.c |    2 +-
 fs/nfsd/nfsd.h    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index c8bf405..9d4a768 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1963,7 +1963,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 		if ((buflen -= 4) < 0)
 			goto out_resource;
 		if (exp->ex_flags & NFSEXP_NOSUBTREECHECK)
-			WRITE32(NFS4_FH_PERSISTENT);
+			WRITE32(NFS4_FH_PERSISTENT|NFS4_FH_VOLATILE_ANY);
 		else
 			WRITE32(NFS4_FH_PERSISTENT|NFS4_FH_VOL_RENAME);
 	}
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 7ecfa24..959652c 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -124,7 +124,7 @@ void		nfsd_lockd_shutdown(void);
 #define	nfserr_nametoolong	cpu_to_be32(NFSERR_NAMETOOLONG)
 #define	nfserr_notempty		cpu_to_be32(NFSERR_NOTEMPTY)
 #define	nfserr_dquot		cpu_to_be32(NFSERR_DQUOT)
-#define	nfserr_stale		cpu_to_be32(NFSERR_STALE)
+#define	nfserr_stale		cpu_to_be32(NFS4ERR_FHEXPIRED)
 #define	nfserr_remote		cpu_to_be32(NFSERR_REMOTE)
 #define	nfserr_wflush		cpu_to_be32(NFSERR_WFLUSH)
 #define	nfserr_badhandle	cpu_to_be32(NFSERR_BADHANDLE)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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