Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp493466pxk; Thu, 17 Sep 2020 08:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ8E0Ya4oZU3u7ZHJZ8Uc135UJR5AfOmNHBnxNLoqVS/BLbDg6KMNupxOiUDjmBDUIWJVF X-Received: by 2002:a05:6402:3075:: with SMTP id bs21mr33990496edb.236.1600356185054; Thu, 17 Sep 2020 08:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600356185; cv=none; d=google.com; s=arc-20160816; b=hRg8cwwC0g6oTS5XNp98YBfy83AWY2HP7xz7EQ8DCq9EN/NYAnBjFKPWFK2T1uE/H7 IOMtsD7nsO97J1U9eyeFthDzQ7VU6QLrgKkPd/RcKbuxZo/OdqFOSvfc/EwowbuvQ5bf /MzJutI/bo/Mva7pezk0B//aEDmf9Pnev8qOx5DHD77MFt0XjUyTNDl/lyyQ9vVcx9fw 8sKwd/F4VDnd0huwSAYO1qS05WvBFtREaFTH+ceQoDG+yew4HGC70VkbTzepnRtD6DLz 6WhacTrzTVeSKUQRkPAWSiazJ9NbHl8qfed1H/8e8oAqKPMdyaYpKM1P083Qu8bEOSlH 6hHA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7PovnjudVvfMFRelS0S3FBS5rSwGm8lIgwb2+HktnS4=; b=bSRe20atDGSMViiBNDEi6lAYWcXhi0cKZcS/h8GyF824guzSWuAsFuDE2bWw4/m7L/ D3SfTrpsLiJWdMwIy8VcKl6jN9lcntMYgB5WrgnpmX7AOmQoWeiU5jtu079y35ayvjh4 T+hHN79+AtbTDbeau9tZDQwp4K9ysVtlEnBjM2iYB33db4eCukoNC+e/7iSwKgz4fFSf dFqhp9fmAD+oLILK6T7KjVtvMuohE97892N5ugkprvAAHZvBhPRrGirQyATKuw/EW2wU NqAYVh2rYBt88R99PQ2NwPV6I/a0mgf2HyaTWf39vdK7rVjrmBev+PgiLcKz8DxqLfX3 IMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=D645jx3+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx6si8465588edb.437.2020.09.17.08.22.40; Thu, 17 Sep 2020 08:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@infradead.org header.s=casper.20170209 header.b=D645jx3+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728142AbgIQPV0 (ORCPT + 99 others); Thu, 17 Sep 2020 11:21:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbgIQPLm (ORCPT ); Thu, 17 Sep 2020 11:11:42 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50087C06121C; Thu, 17 Sep 2020 08:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=7PovnjudVvfMFRelS0S3FBS5rSwGm8lIgwb2+HktnS4=; b=D645jx3+cFCsRRamnPvY93SEZp 5idHKpebB8d3ADFC2w4jUoevXr+eTIRxNa5kP7rmXI6dNgJMDifFkNUwyxkfzlOpmnvRWxVU5jou6 Xw3Ux6iN9o3h3kHwgElGrUzy3LHDgVNd3s5BPl5exxvz1fUpq9hJvXiR37faoM+sF3w8SWjVVHpn7 XgSvgnOD/jvaGa9gFE7xBAHrq5dHmW9PfWz6ML6kWQtUWTATDyCEZSzBC/OaokwaNH9edWskgRnmd ND+y1E4RMQjT3HXerG2yb2g3MloOlpPyn3rFXB+gng2IT5jOzDOkDYvVy7UnUbP3VIkuuaEa5JGWf 4qy4un+Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYi-0001PN-HJ; Thu, 17 Sep 2020 15:10:52 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, ecryptfs@vger.kernel.org, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, Richard Weinberger Subject: [PATCH 02/13] 9p: Tell the VFS that readpage was synchronous Date: Thu, 17 Sep 2020 16:10:39 +0100 Message-Id: <20200917151050.5363-3-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200917151050.5363-1-willy@infradead.org> References: <20200917151050.5363-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 9p readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/9p/vfs_addr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index cce9ace651a2..506ca0ba2ec7 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -65,7 +65,7 @@ static int v9fs_fid_readpage(void *data, struct page *page) SetPageUptodate(page); v9fs_readpage_to_fscache(inode, page); - retval = 0; + return AOP_UPDATED_PAGE; done: unlock_page(page); @@ -280,6 +280,10 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping, goto out; retval = v9fs_fid_readpage(v9inode->writeback_fid, page); + if (retval == AOP_UPDATED_PAGE) { + retval = 0; + goto out; + } put_page(page); if (!retval) goto start; -- 2.28.0