[PATCH] knfsd: nfsd4: actually use all the pieces to implement referrals

Use all the pieces set up so far to implement referral support, allowing
return of NFS4ERR_MOVED and fs_locations attribute.

Signed-off-by: Manoj Naik <manoj@almaden.ibm.com>
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
J.Bruce Fields
2006-10-04 02:16:20 -07:00
committed by Linus Torvalds
parent 81c3f41302
commit 42ca099381
3 changed files with 69 additions and 13 deletions

View File

@@ -802,13 +802,29 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
* SETCLIENTID_CONFIRM, PUTFH and PUTROOTFH
* require a valid current filehandle
*/
if ((!current_fh->fh_dentry) &&
!((op->opnum == OP_PUTFH) || (op->opnum == OP_PUTROOTFH) ||
(op->opnum == OP_SETCLIENTID) ||
(op->opnum == OP_SETCLIENTID_CONFIRM) ||
(op->opnum == OP_RENEW) || (op->opnum == OP_RESTOREFH) ||
(op->opnum == OP_RELEASE_LOCKOWNER))) {
op->status = nfserr_nofilehandle;
if (!current_fh->fh_dentry) {
if (!((op->opnum == OP_PUTFH) ||
(op->opnum == OP_PUTROOTFH) ||
(op->opnum == OP_SETCLIENTID) ||
(op->opnum == OP_SETCLIENTID_CONFIRM) ||
(op->opnum == OP_RENEW) ||
(op->opnum == OP_RESTOREFH) ||
(op->opnum == OP_RELEASE_LOCKOWNER))) {
op->status = nfserr_nofilehandle;
goto encode_op;
}
}
/* Check must be done at start of each operation, except
* for GETATTR and ops not listed as returning NFS4ERR_MOVED
*/
else if (current_fh->fh_export->ex_fslocs.migrated &&
!((op->opnum == OP_GETATTR) ||
(op->opnum == OP_PUTROOTFH) ||
(op->opnum == OP_PUTPUBFH) ||
(op->opnum == OP_RENEW) ||
(op->opnum == OP_SETCLIENTID) ||
(op->opnum == OP_RELEASE_LOCKOWNER))) {
op->status = nfserr_moved;
goto encode_op;
}
switch (op->opnum) {