Răsfoiți Sursa

nfsd4: delay setting current filehandle till success

Compound processing stops on error, so the current filehandle won't be
used on error.  Thus the order here doesn't really matter.  It'll be
more convenient to do it later, though.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
J. Bruce Fields 13 ani în urmă
părinte
comite
41fd1e42f8
1 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 3 5
      fs/nfsd/nfs4proc.c

+ 3 - 5
fs/nfsd/nfs4proc.c

@@ -247,16 +247,14 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 	if (is_create_with_attrs(open) && open->op_acl != NULL)
 	if (is_create_with_attrs(open) && open->op_acl != NULL)
 		do_set_nfs4_acl(rqstp, &resfh, open->op_acl, open->op_bmval);
 		do_set_nfs4_acl(rqstp, &resfh, open->op_acl, open->op_bmval);
 
 
-	set_change_info(&open->op_cinfo, current_fh);
-	fh_dup2(current_fh, &resfh);
-
 	/* set reply cache */
 	/* set reply cache */
 	fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
 	fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
 			&resfh.fh_handle);
 			&resfh.fh_handle);
 	if (!open->op_created)
 	if (!open->op_created)
-		status = do_open_permission(rqstp, current_fh, open,
+		status = do_open_permission(rqstp, &resfh, open,
 					    NFSD_MAY_NOP);
 					    NFSD_MAY_NOP);
-
+	set_change_info(&open->op_cinfo, current_fh);
+	fh_dup2(current_fh, &resfh);
 out:
 out:
 	fh_put(&resfh);
 	fh_put(&resfh);
 	return status;
 	return status;