From patchwork Fri Aug 19 17:24:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1081572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7JHLUCB013046 for ; Fri, 19 Aug 2011 17:24:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756510Ab1HSRYS (ORCPT ); Fri, 19 Aug 2011 13:24:18 -0400 Received: from fieldses.org ([174.143.236.118]:60885 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756355Ab1HSRYR (ORCPT ); Fri, 19 Aug 2011 13:24:17 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1QuSno-0000JY-Ur for linux-nfs@vger.kernel.org; Fri, 19 Aug 2011 13:24:16 -0400 Date: Fri, 19 Aug 2011 13:24:16 -0400 To: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd4: fix seqid_mutating_error Message-ID: <20110819172416.GA1112@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 19 Aug 2011 17:24:19 +0000 (UTC) Yipes--noticed while doing some unrelated v4 state work. I'll probably send this along soonish. --b. commit 8eea0f78ed3f3238e238c8ca76e5c7a5c1e7b5f5 Author: J. Bruce Fields Date: Wed Aug 10 19:16:22 2011 -0400 nfsd4: fix seqid_mutating_error The set of errors here does *not* agree with the set of errors specified in the rfc! While we're there, turn this macros into a function, for the usual reasons, and move it to the one place where it's actually used. Cc: stable@kernel.org Signed-off-by: J. Bruce Fields --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index c8bf405..f810996 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1623,6 +1623,18 @@ static void write_cinfo(__be32 **p, struct nfsd4_change_info *c) \ save = resp->p; +static bool seqid_mutating_err(__be32 err) +{ + /* rfc 3530 section 8.1.5: */ + return err != nfserr_stale_clientid && + err != nfserr_stale_stateid && + err != nfserr_bad_stateid && + err != nfserr_bad_seqid && + err != nfserr_bad_xdr && + err != nfserr_resource && + err != nfserr_nofilehandle; +} + /* * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This * is where sequence id's are incremented, and the replay cache is filled. diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 4eefaf1..5cfebe5 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -447,12 +447,6 @@ struct nfs4_stateid { #define WR_STATE 0x00000020 #define CLOSE_STATE 0x00000040 -#define seqid_mutating_err(err) \ - (((err) != nfserr_stale_clientid) && \ - ((err) != nfserr_bad_seqid) && \ - ((err) != nfserr_stale_stateid) && \ - ((err) != nfserr_bad_stateid)) - struct nfsd4_compound_state; extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,