aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2015-03-19 07:04:14 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-03-20 12:43:59 -0400
commit6f8f28ec5f88715515e70dd52f16b326a5e63f81 (patch)
treed4e94ea7c71697a35efd24869a4ffe3542e7ef50
parent715a03d2848275269bd4014a49212cc83452f32d (diff)
NFSD: Check layout type when returning client layouts
According to RFC5661: " When lr_returntype is LAYOUTRETURN4_FSID, the current filehandle is used to identify the file system and all layouts matching the client ID, the fsid of the file system, lora_layout_type, and lora_iomode are returned. When lr_returntype is LAYOUTRETURN4_ALL, all layouts matching the client ID, lora_layout_type, and lora_iomode are returned and the current filehandle is not used. " When returning client layouts, always check layout type. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4layouts.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 0a616b51c5bb..6964613bad90 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -513,6 +513,9 @@ nfsd4_return_client_layouts(struct svc_rqst *rqstp,
513 513
514 spin_lock(&clp->cl_lock); 514 spin_lock(&clp->cl_lock);
515 list_for_each_entry_safe(ls, n, &clp->cl_lo_states, ls_perclnt) { 515 list_for_each_entry_safe(ls, n, &clp->cl_lo_states, ls_perclnt) {
516 if (ls->ls_layout_type != lrp->lr_layout_type)
517 continue;
518
516 if (lrp->lr_return_type == RETURN_FSID && 519 if (lrp->lr_return_type == RETURN_FSID &&
517 !fh_fsid_match(&ls->ls_stid.sc_file->fi_fhandle, 520 !fh_fsid_match(&ls->ls_stid.sc_file->fi_fhandle,
518 &cstate->current_fh.fh_handle)) 521 &cstate->current_fh.fh_handle))