From patchwork Tue Jun 17 10:14:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4365691 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C38E69F26E for ; Tue, 17 Jun 2014 10:14:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCEEE20204 for ; Tue, 17 Jun 2014 10:14:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9C1320200 for ; Tue, 17 Jun 2014 10:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753268AbaFQKOP (ORCPT ); Tue, 17 Jun 2014 06:14:15 -0400 Received: from mail-qc0-f178.google.com ([209.85.216.178]:35174 "EHLO mail-qc0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753135AbaFQKOO (ORCPT ); Tue, 17 Jun 2014 06:14:14 -0400 Received: by mail-qc0-f178.google.com with SMTP id c9so9486066qcz.37 for ; Tue, 17 Jun 2014 03:14:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=KkdJToIKz9IOOIbH10FY6AfZ4r3a8JwQFZlMQljy+k4=; b=gW6Ivq9SiLAC3VLew1mBdQ0yzIc/len6cllp9pUprP0knYknbiNiA6FjjIOVXoZG+Y RszAlRHRVza/gSm5aJk4ouYM7UVUM3/GkuONaYY77k5e/ZAD/XmKJPWrDf7fPQW58Yoc +meSvg4heUp4lbwWwgc6NrB/T9AukOuVjuR2XMMZkCeSsuFBswavvgSkrm5AXO2JyXLh Ly+wtQ0Pa82hOx4a8aFp7j7R3Yk8Rczx/RCROao60aGD0NpK6af/sQS7A/Aow5TYkW/5 xSD8GlFDL7AkJnBDRBu+JI5Q+ITNHxQimCqW+NwoO1SSfybxA7arTEsDc2GQqwLNR7Tx vj0w== X-Gm-Message-State: ALoCoQn1pWWkUJRAIzb5cc6Exr6pozdyQa3SiIvnHTrXfTX6DyaXHlc2G4CuaWzPqIgBMB07aAM5 X-Received: by 10.140.42.19 with SMTP id b19mr11306270qga.109.1403000053899; Tue, 17 Jun 2014 03:14:13 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 2sm17316643qag.28.2014.06.17.03.14.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jun 2014 03:14:13 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: fix return of nfs4_acl_write_who Date: Tue, 17 Jun 2014 06:14:08 -0400 Message-Id: <1403000048-31245-1-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 AFAICT, the only way to hit this error is to pass this function a bogus "who" value. In that case, we probably don't want to return -1 as that could get sent back to the client. Turn this into nfserr_serverfault, which is a more appropriate error for a server bug like this. Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig --- fs/nfsd/nfs4acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index d714156a19fd..b0cf00d3ee7d 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c @@ -935,5 +935,5 @@ __be32 nfs4_acl_write_who(struct xdr_stream *xdr, int who) return 0; } WARN_ON_ONCE(1); - return -1; + return nfserr_serverfault; }