From patchwork Fri Mar 27 16:50:34 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: 6109781 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 38ACDBF90F for ; Fri, 27 Mar 2015 16:54:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60695203C3 for ; Fri, 27 Mar 2015 16:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DB8B203AD for ; Fri, 27 Mar 2015 16:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753185AbbC0Qx5 (ORCPT ); Fri, 27 Mar 2015 12:53:57 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:38071 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754076AbbC0Qwb (ORCPT ); Fri, 27 Mar 2015 12:52:31 -0400 Received: by wibgn9 with SMTP id gn9so39228609wib.1; Fri, 27 Mar 2015 09:52:30 -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=rv7sRcF2EjGBQsaqzriMYsb1X5zCBGXbQMUnSRTX5+j9kI3ovtGFOUxgCwfZFHPT4T Zp9IdLvvkXkPw1NXfllQkkbsR5N1KJFAhrfSD6Ay0fze2XPawkaCBSVr2ehVeb8y0qhH kQzeugQ/n3zKNVEIFwXw+oiLg5M1QfvLKDW6qzQlP04wIqW7ENBMnTC6FrJNxZ4YdKRr RvDDsRaoLA2wniSO46QOukUuROlwafvOKGoUWtb4lO8hrnQtFVfJDExb61aLDB//lig1 UQjYqx/KLuV9HSEXpx389gC87EeGgeLzIw8oIKi2iw8J0BorYd/uXdZQh4PDzrsGARKi R4YA== X-Received: by 10.180.89.34 with SMTP id bl2mr58895399wib.23.1427475150267; Fri, 27 Mar 2015 09:52:30 -0700 (PDT) Received: from nuc.home.com (80-110-94-70.cgn.dynamic.surfer.at. [80.110.94.70]) by mx.google.com with ESMTPSA id j7sm3592306wix.4.2015.03.27.09.52.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 09:52:29 -0700 (PDT) From: Andreas Gruenbacher X-Google-Original-From: Andreas Gruenbacher To: Trond Myklebust , Anna Schumaker , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [RFC 36/39] nfs3: Return posix acl encode errors Date: Fri, 27 Mar 2015 17:50:34 +0100 Message-Id: <9c3090e1997518306025ddd0c55dccbc8d97c130.1427471526.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; }