Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp894367pxf; Wed, 7 Apr 2021 14:22:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbwdUkJHX39pY6SLVkwiP7ijJ1zzj/bub0MYJkMKT2v5Qb4oy2GHsKdIgppmD6YdGPGr8D X-Received: by 2002:a17:906:4e13:: with SMTP id z19mr6241686eju.340.1617830576951; Wed, 07 Apr 2021 14:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617830576; cv=none; d=google.com; s=arc-20160816; b=MhcR0nf8xLM1xaN0xBwVkUSLTNe7DaDaojug2tRt1+VoDIdZVDzdpSuiiTLKf0MtGN 39XVxWsc2cZEfrXX5SRlmSr/rrJ5rpNGNIJ7jEaJ8qYRZajZnRMPIpB4uxAjSuJR/tCS BrV2xzowLlQg1QjCqHaDHi3r0e6gMtSzlIuAFcQTB/2/Qp6g7F2C/7qM0qfPg0fhT+Bg apuuzx+3lMvJ0YegJooyiCSzDYJvBSpyOT6TCKHIkm48XxCBKpaffUbtiP1BT9ObkD3M YxHi8wXp48UtAyDFXgr1NxSPh3Mvmg6BrogVSUke3zqurQpgDtfyKhGSUGDbmZ+41G1U pylQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=axULdzcQx68+oS63cjAxzUVds96V+wt/l0Sxopf5YMM=; b=PcZRDS9005azw78MToUObQ1r3IJNsCloGUSnxW1/pM3HiRfSeiEx3Ht2wrs+0SCTu5 Dr9SKICbdaa0w3cdFym+V2o8m8pLmcgNd1xSeLeasZZG8JzuY74mC1BBXCR8K7OGv7cw 4Ntc+cs7REvbw3LjDMhoopJkSHbf/FSLNRJEYL1o5fd7o5zTbFANDWFKBon2AXSQyqZ+ En8BGeyF0KsCy/0hXNxjkcUiCxQxP1FQ1+q+JiiK8kspuF3ymIzbsqIoFlaEzkxU9NtP 9l1570vF8IfEQsRzUAOFPnozXBV1w8fZrXYWb9zhoMJJeQrIEsAgcAsLJxzi1nF9+tHB ReLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i5bFNYWe; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si19766006ejk.68.2021.04.07.14.22.34; Wed, 07 Apr 2021 14:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i5bFNYWe; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353779AbhDGPrp (ORCPT + 99 others); Wed, 7 Apr 2021 11:47:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59978 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353752AbhDGPrk (ORCPT ); Wed, 7 Apr 2021 11:47:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617810449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=axULdzcQx68+oS63cjAxzUVds96V+wt/l0Sxopf5YMM=; b=i5bFNYWewJLx/e4iTttzWw+6vViiHj7aeo1122twDp6KhcUR1yhhVZ23545kZ+oSseCz+D WvdlEtewsv+em1oYNtf08D8GZpuyhJ8zErMS8bC7QjL+DpfasEKAfgPeW5WaH8gM11Fx7M mIHSaMipD3ErEqdjsa6ThT8nh30OpYI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-_0wcNwU5NAO4X8QXnKaQBA-1; Wed, 07 Apr 2021 11:47:27 -0400 X-MC-Unique: _0wcNwU5NAO4X8QXnKaQBA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0405E10054F6; Wed, 7 Apr 2021 15:47:26 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-115-201.rdu2.redhat.com [10.10.115.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EE071045D01; Wed, 7 Apr 2021 15:47:02 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 1/5] netfs: Fix a missing rreq put in netfs_write_begin() From: David Howells To: jlayton@kernel.org Cc: dwysocha@redhat.com, linux-cachefs@redhat.com, v9fs-developer@lists.sourceforge.net, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 07 Apr 2021 16:47:01 +0100 Message-ID: <161781042127.463527.9154479794406046987.stgit@warthog.procyon.org.uk> In-Reply-To: <161781041339.463527.18139104281901492882.stgit@warthog.procyon.org.uk> References: <161781041339.463527.18139104281901492882.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org netfs_write_begin() needs to drop a ref on the read request if the network filesystem gives an error when called to begin the caching op. Signed-off-by: David Howells --- fs/netfs/read_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c index 3498bde035eb..0066db21aa11 100644 --- a/fs/netfs/read_helper.c +++ b/fs/netfs/read_helper.c @@ -1169,6 +1169,8 @@ int netfs_write_begin(struct file *file, struct address_space *mapping, _leave(" = 0"); return 0; +error_put: + netfs_put_read_request(rreq, false); error: unlock_page(page); put_page(page);