Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp914438ybb; Wed, 1 Apr 2020 11:59:26 -0700 (PDT) X-Google-Smtp-Source: APiQypI8OVkpYC/3NQyfCnUMV5P+QXgioiuzaKy3hDx/2rT8K7XnvdwZFPTornWecLEnZUNVgqp9 X-Received: by 2002:aca:4a56:: with SMTP id x83mr4048222oia.166.1585767565935; Wed, 01 Apr 2020 11:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585767565; cv=none; d=google.com; s=arc-20160816; b=l96w/jq97Wi2kN4v9JKr3fgb6w6BtEli3Mk/jXe05J2k3nI/qrJRXU2rAW7Gk632OY /RbI6aqeq6a0VI1xO++/6V6Op94O0ZaVPOK9btXo32Wh1T3+ZLhJuxOCET6g7ho4MoFM xJ3PhwPoi/PfrLxaWzpkSbKB+/Tt0GL0wjn6vZWs6URY392f+MxM7pqfooZOklVAs4CA 7B5OlcifEHAjB6fDDGgWLkNVLGcD4tazj099vvofepfI9WqxSEAHb2LweEpTr6K+RRRZ 98sIRttRzfN+bZkOLVom5ikFmSLG59cvTtZZKk6qg8qkZluQKShratMookBWSEY9hA4P lCkA== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=98QuYk9kAJ7Frink8Oyazb2AqTn6SoYc6tvQue+ZTyA=; b=b/Bck4jzeI8NfSwcI1pq+FXmm7HDO1PxY+Bj4HOv8c4tlFctyALCjuLfdgoA5TmZGH EJFfkaAv/MMTQKCSwI7PD0nVsooC1tMv557K8piObHQFkar9is6sWOPPuzDc/gmUAD+m C+XJKLjvlYb9mXVoLXCwU6tt/Xq5NlWBDrzdkcCmbXgh9I2abDwoshRT74JioULXYDGd aIcbCPG+2NmIwc9SXD2rU6QPp7z0xuhA1xngP4lXxCe5PsLmAAh47zqa/c3GajTbfATV 6Q+qGbJ/yKDADG29iK4znrR/FbH3EClhQwVVuyfVNh4VZvVo+G0wkZclp/JhT1zCtRFA +RhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z7c0y4U8; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si1202766oii.86.2020.04.01.11.59.07; Wed, 01 Apr 2020 11:59:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=z7c0y4U8; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732148AbgDAS7C (ORCPT + 99 others); Wed, 1 Apr 2020 14:59:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732211AbgDAS7C (ORCPT ); Wed, 1 Apr 2020 14:59:02 -0400 Received: from localhost.localdomain (c-68-36-133-222.hsd1.mi.comcast.net [68.36.133.222]) (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 1E57E207FF for ; Wed, 1 Apr 2020 18:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585767542; bh=RODUwAhVKI/sjSWmzSh5I+TaLw3MXqfk3S9LJvnSulc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=z7c0y4U8CBl/nlKWIx8GC8GXk25WyZNAiDkYtdhhEOwh/PSFLW8vdonH3ORZlmrrI +Y51uXIm7LjXHk2rJ5nrA2k0sHN5ymuYTs3NKwrB+fGIjT61LXjCedqMNs0dab5vpf iwmGIVh6WGgg6Jd3Hxu8g0wu9o9/VMcn7FLnEHyo= From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 04/10] NFS: Fix a request reference leak in nfs_direct_write_clear_reqs() Date: Wed, 1 Apr 2020 14:56:46 -0400 Message-Id: <20200401185652.1904777-5-trondmy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401185652.1904777-4-trondmy@kernel.org> References: <20200401185652.1904777-1-trondmy@kernel.org> <20200401185652.1904777-2-trondmy@kernel.org> <20200401185652.1904777-3-trondmy@kernel.org> <20200401185652.1904777-4-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust nfs_direct_write_scan_commit_list() will lock the request and bump the reference count, but we also need to account for the reference that was taken when we initially added the request to the commit list. Fixes: fb5f7f20cdb9 ("NFS: commit errors should be fatal") Signed-off-by: Trond Myklebust --- fs/nfs/direct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 51ab4627c4d6..8074304fd5b4 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -646,6 +646,7 @@ static void nfs_direct_write_clear_reqs(struct nfs_direct_req *dreq) while (!list_empty(&reqs)) { req = nfs_list_entry(reqs.next); nfs_list_remove_request(req); + nfs_release_request(req); nfs_unlock_and_release_request(req); } } -- 2.25.1