From patchwork Sun Oct 6 07:44:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2992551 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98356BF924 for ; Sun, 6 Oct 2013 07:44:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CECB9201FA for ; Sun, 6 Oct 2013 07:44:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B7F1201EC for ; Sun, 6 Oct 2013 07:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506Ab3JFHol (ORCPT ); Sun, 6 Oct 2013 03:44:41 -0400 Received: from mail-ee0-f47.google.com ([74.125.83.47]:43732 "EHLO mail-ee0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373Ab3JFHol (ORCPT ); Sun, 6 Oct 2013 03:44:41 -0400 Received: by mail-ee0-f47.google.com with SMTP id d49so2551140eek.6 for ; Sun, 06 Oct 2013 00:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=ieoNz+F0nR2/GAjBqancVuAbEI9qRMAfJhTqitIi068=; b=IG0/Rkb0F59FFiNsuCa5pK7bJOSjiTt+VhVbyqVjceBpUim8i7EcNXb0gRKZR4IkkJ LSDXQMGrJGqSG2AqRP9X68/V39R+P2vTdch8u5SZm1rmkx7zABfMT25gQC6FxDng9Zyn q1hkrhE27c6EDUHt5K9vlUSv7qyKWFB1Jgk1jjUqYxaUH75EYUPsC2afF0vi4rjm44Xf Szwbj3miOkMKrh4zONyCIH1o+webeuevuMuscS0dbO2MB30xIlYHDrE6hAvN6jXKyb6I aXPyGTEicKrv7z7WbDmJrb9DjtFfpfJvveQEV6gsNObkBVdZ9USekSwFVEfjB6XW2Mgr Bn4Q== X-Received: by 10.15.43.13 with SMTP id w13mr37349259eev.37.1381045480009; Sun, 06 Oct 2013 00:44:40 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com (bzq-80-49-130.static.bezeqint.net. [82.80.49.130]) by mx.google.com with ESMTPSA id m54sm48401008eex.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Oct 2013 00:44:39 -0700 (PDT) From: Benny Halevy To: linux-nfs@vger.kernel.org Subject: [PATCH 4/4] SQUASHME: pnfsd: fixup error code for layout_commit Date: Sun, 6 Oct 2013 10:44:36 +0300 Message-Id: <1381045476-30766-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <5251140B.4000203@primarydata.com> References: <5251140B.4000203@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c index a117a5d..e37a169 100644 --- a/fs/nfsd/nfs4pnfsd.c +++ b/fs/nfsd/nfs4pnfsd.c @@ -949,8 +949,12 @@ struct super_block * nfserr = nfs4_process_layout_stateid(clp, &lcp->lc_sid, NFS4_LAYOUT_STID, &ls); nfs4_unlock_state(); - if (nfserr) + if (nfserr) { + /* fixup error code as per RFC5661 */ + if (nfserr == nfserr_bad_stateid) + nfserr = nfserr_badlayout; goto out; + } if (sb->s_pnfs_op->layout_commit) { struct nfs4_file *fp = ls->ls_file;