From patchwork Fri Apr 24 11:04:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Gr=C3=BCnbacher?= X-Patchwork-Id: 6267941 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0D4FFBF4A6 for ; Fri, 24 Apr 2015 11:08:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B3A0201E4 for ; Fri, 24 Apr 2015 11:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6784C200F3 for ; Fri, 24 Apr 2015 11:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964889AbbDXLId (ORCPT ); Fri, 24 Apr 2015 07:08:33 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:35069 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030307AbbDXLFq (ORCPT ); Fri, 24 Apr 2015 07:05:46 -0400 Received: by wgyo15 with SMTP id o15so46720364wgy.2; Fri, 24 Apr 2015 04:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references:in-reply-to :references; bh=kFF3slGPLbnaD2QPxcC3e2nf6Z/hS4GDKdvd1XTx9W4=; b=WKvAf5bJtzfHAm+OIhzwOxgfRwTdngYiupVIOAv1K0BBsmcghtuD/vEvWIwwK85Iad +jj3tGx+0pzS51NDROucSj04k0aLzK6nnDoSUKu3CqEet44n4tVbbdqZGAz9/2zjlhOo yf8c8BLaN1Li4JMzltqri70yV0WkPe8AA70OrEqyOU/2DkeAWEPZ3nO3Oo3zGkoowlcC KP2sdy/Zo9oQoXCfMpji10KkXQ82cfSbYMc9LkbDSaWtMQCTF8TVX0K/vyQYlxsRaAOo dEQ7+qwSOJI+OOK6FWsqnKRPsSvvPthOCREAW7F/KyP2wyc2tBxGtrhUJlzjbqJNu085 MxTw== X-Received: by 10.180.74.238 with SMTP id x14mr2839386wiv.81.1429873545005; Fri, 24 Apr 2015 04:05:45 -0700 (PDT) Received: from nuc.home.com (80-110-112-232.cgn.dynamic.surfer.at. [80.110.112.232]) by mx.google.com with ESMTPSA id ch6sm16410648wjc.3.2015.04.24.04.05.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2015 04:05:44 -0700 (PDT) From: Andreas Gruenbacher X-Google-Original-From: Andreas Gruenbacher To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [RFC v3 39/45] nfs3: Return posix acl encode errors Date: Fri, 24 Apr 2015 13:04:36 +0200 Message-Id: <37d63348271de5619e0eee623192600a6d375f0a.1429868795.git.agruenba@redhat.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 When an error occurs when encoding a posix acl, return the error instead of causing a BUG(). Signed-off-by: Andreas Gruenbacher --- fs/nfs/nfs3xdr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 8b880f7..de6f12c 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -1384,13 +1384,14 @@ static int nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, error = nfsacl_encode(xdr->buf, base, args->inode, (args->mask & NFS_ACL) ? args->acl_access : NULL, 1, 0); - /* FIXME: this is just broken */ - BUG_ON(error < 0); + if (error < 0) + return error; error = nfsacl_encode(xdr->buf, base + error, args->inode, (args->mask & NFS_DFACL) ? args->acl_default : NULL, 1, NFS_ACL_DEFAULT); - BUG_ON(error < 0); + if (error < 0) + return error; return 0; }