From patchwork Mon Dec 9 10:23:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 3310161 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 39053C0D4A for ; Mon, 9 Dec 2013 10:23:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20EB9201BC for ; Mon, 9 Dec 2013 10:23:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DE70200F7 for ; Mon, 9 Dec 2013 10:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754934Ab3LIKXw (ORCPT ); Mon, 9 Dec 2013 05:23:52 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:35893 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371Ab3LIKXv (ORCPT ); Mon, 9 Dec 2013 05:23:51 -0500 Received: by mail-pd0-f178.google.com with SMTP id y10so4960894pdj.23 for ; Mon, 09 Dec 2013 02:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=XCowCoy96chEUhbPyEVu2/ySCyndwFNI75rnw3xLM1U=; b=cKCH+XVby+PNWPqtd/VKr97OUm7B4iTdmtNIX/3OcgBNIXvsFx+UElsd+LH5MOqkag HYDl+H+7miS+WdxhwU87Z1rYuloE/hhN3rQUDamZBQUbpdLvSpF1UC+z/8/HpZxZmmFA U50MnvIAnyhdDnrkCrIeU9PVokLEMTBHAuQtRqfjlkLl7xF12aifVXpjU181hyfNGUZL BurXhzTjofFsRgRe3S9nsI7yqL2XZqwTfcRCOnQgstGMi4Y4SKKm5lQymc5h/QlgAeBU YKnpsXL1n4JnhRLKMqgBpdq7pdksHsBspMro7ApQrrgb4lEog6JHBHV8vh3DWOibZjMz h9Ng== X-Received: by 10.69.31.170 with SMTP id kn10mr19668601pbd.106.1386584630662; Mon, 09 Dec 2013 02:23:50 -0800 (PST) Received: from [10.10.19.201] ([211.103.180.226]) by mx.google.com with ESMTPSA id xv2sm16938020pbb.39.2013.12.09.02.23.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 02:23:49 -0800 (PST) Message-ID: <52A59A32.10500@gmail.com> Date: Mon, 09 Dec 2013 18:23:46 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131030 Thunderbird/17.0.10 MIME-Version: 1.0 To: "J. Bruce Fields" CC: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: clean up unnecessary temporary variable in nfsd4_decode_fattr 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, 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 host_err was only used for nfs4_acl_new. This patch delete it, and return nfserr_jukebox directly. Signed-off-by: Kinglong Mee --- fs/nfsd/nfs4xdr.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index fd48536..91afb1c 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -252,7 +252,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, int expected_len, len = 0; u32 dummy32; char *buf; - int host_err; DECODE_HEAD; iattr->ia_valid = 0; @@ -279,10 +278,9 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, return nfserr_resource; *acl = nfs4_acl_new(nace); - if (*acl == NULL) { - host_err = -ENOMEM; - goto out_nfserr; - } + if (*acl == NULL) + return nfserr_jukebox; + defer_free(argp, kfree, *acl); (*acl)->naces = nace; @@ -420,10 +418,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, goto xdr_error; DECODE_TAIL; - -out_nfserr: - status = nfserrno(host_err); - goto out; } static __be32