Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3474187imu; Sun, 11 Nov 2018 15:56:38 -0800 (PST) X-Google-Smtp-Source: AJdET5dPvIAsOxYR+VN/v0Lv6tO4zzcQ5y8TrI2qYhlVmUzX6/XNkzK3o01xeVNibYX1MhVDBKz+ X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr17886907plb.214.1541980598711; Sun, 11 Nov 2018 15:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980598; cv=none; d=google.com; s=arc-20160816; b=S+wphEk2KfnyDrqg3iQtqUrLDGqJVlnfSY/0Nb5+L9h1hKavwHznpqFbZDoglnN+Vb kiQ0LrpcHbgi4MhAMSYptdN3mTaGR34Y5oUIObI6Or9qt8pK/vET1+ICQPxWfFJ8+fA0 YS0xjlvWRsf6lxDC0ra5xPaXh4wqi6Yf8q5pnZEhJ/x4c0SB6cM3PW7PMP/srx78xEyR WJttTpzIOqQ41UmM1lvkPIi/WW+vFP7hC5BGxZRaxiHyvZw1/ZqxfvKbpNe/CMPCBBK+ jmpjYc7hQxazM97cuYaMYVslw8vjiuawTkR0wKoZfpN7ErdFVdrPICuvMmUFmGK3nx6h 6MIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ufZQmqWeUMUiZWrSvnitLabN/m2CSr3XLJs8Cbx5BKE=; b=jRc7ZARw7MY/EUwDFqcf9TzWq5UjOMNv5TJf32i8FiqPW7DTfWknfLJx44kKx4X6Dz tq6fWvBb01jXWrwHpqSVGiN1/W7y0c5krUi0L9vFy/ZkKZQ4nyhCeHbUY9KGXasIwUVy jtAMP7+vkN/JTaCjt9wNqXd08/Doc5d7vT3SNZ7OHzP2zEif0UWkOWL5qecPwRfGlUw4 tXZsN24/UP0kbP6tw02Nsm8c+DixC2ZOlzjTnrloQdJljU8Q0xLLd4nD10wOLzppog3M KFD/44XnpAKPB11YUKKOj+UQaPyeVfjkZquZbhXgJMmGWiXFhyVNypyoE5uQzzstYVSN w37A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S9wsra+T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si2227200pli.239.2018.11.11.15.56.23; Sun, 11 Nov 2018 15:56:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S9wsra+T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732929AbeKLJpO (ORCPT + 99 others); Mon, 12 Nov 2018 04:45:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:37256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732652AbeKLISV (ORCPT ); Mon, 12 Nov 2018 03:18:21 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 236CB21707; Sun, 11 Nov 2018 22:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975305; bh=WVomlRGZ+TpigkKJYugZPNTy5MIpt4fBy8nD3S4lY9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S9wsra+TKG1LRlhzzNZ0okFd93t0lRClrhMoH/08jJLhrlnzlY13/mKFFJnd+RdCd o80wUNT/PCtakg4KqEORpI2OgDlguil2SX0o5VfSkpTQuBySXMOQG546lLu6KibCES zkrSIjVdr6eS3w1XvB5ytY0nb/3J7U6n3LC5mXHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Elble , Jeff Layton , "J. Bruce Fields" Subject: [PATCH 4.19 272/361] nfsd: correctly decrement odstate refcount in error path Date: Sun, 11 Nov 2018 14:20:19 -0800 Message-Id: <20181111221655.121747331@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrew Elble commit bd8d725078867cda250fe94b9c5a067b4a64ca74 upstream. alloc_init_deleg() both allocates an nfs4_delegation, and bumps the refcount on odstate. So after this point, we need to put_clnt_odstate() and nfs4_put_stid() to not leave the odstate refcount inappropriately bumped. Signed-off-by: Andrew Elble Reviewed-by: Jeff Layton Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfs4state.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4364,7 +4364,7 @@ nfs4_set_delegation(struct nfs4_client * fl = nfs4_alloc_init_lease(dp, NFS4_OPEN_DELEGATE_READ); if (!fl) - goto out_stid; + goto out_clnt_odstate; status = vfs_setlease(fp->fi_deleg_file, fl->fl_type, &fl, NULL); if (fl) @@ -4389,7 +4389,6 @@ out_unlock: vfs_setlease(fp->fi_deleg_file, F_UNLCK, NULL, (void **)&dp); out_clnt_odstate: put_clnt_odstate(dp->dl_clnt_odstate); -out_stid: nfs4_put_stid(&dp->dl_stid); out_delegees: put_deleg_file(fp);