Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp530950pxk; Thu, 17 Sep 2020 09:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtWc/Vh11ikA/0R6XbN4UzXtrmmLh0FwvIGb3e/hZzE27pACYa0G1HFPwCdnwUAWJnVec9 X-Received: by 2002:aa7:ce97:: with SMTP id y23mr34835406edv.128.1600359249131; Thu, 17 Sep 2020 09:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600359249; cv=none; d=google.com; s=arc-20160816; b=W9Bm0CPdORFFBlm59X5UuK/7PtkK8kPDHLuIiWpm8eNyEXqjNp0i+2M6VghOADEEyL t7uXiZpK5gL04hQiLVFdoA6rZqs8OmJ6SrV0zXPLiWRHdI3Fd0Vdb2o1WHuqUzL/7M/z dudHLGvcmLiPZJjBz2SVevrlJe1R30vO2sKp/QnREI7tyrkKwJmxgF/Iilumfdew7oFu X705y4a7TueVOaZ9puWh3EFoVBXczLz/WRb+YiLnB4zvHFm6jTjGb58trp5Y4NNAAMoa zJPDKmvgMtnmFYKZsOuUMVwyiEFC0gW55BRWthLdmNAo6+7nakSd2ZqHhVon/MHFPeF3 5pPw== 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=MTLlKe719mgAVscm2w1Ql0nN7cIRPfZQnUskn6+25OA=; b=SHfgH2jT7ej7hYVySsAhvAeyPCOYTro+Fge/TVTJ2BqQNCx09FYFwoCRvblSB56EPD WSLvu5dN+AaWJ+Iv3e4idY6EYyr88PyztJ/a1pxupuV3NQV7lAxY/0/FbodW8HnwTqPW FlQ8C0RhmXTD6PyKVKlJKy3HhO7kbgP8eER5Yd4/uUMF/9x6Fhl4ucSBTNVbFXgoucsB 3mGe3HdnctuCoexT38ZJr66VnzP7DuX20tydlANBRlWu9NSgQwC7/860IB4Ffs9UoAUt sR4JUdHoih3m/uuNX9Xusyfmn7fCjs7y5DLzFa2ho+W7nW1ui9f8N9JdEZBv3abxs9hP E29g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hL1cKoF+; 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 cb11si208688ejb.640.2020.09.17.09.13.44; Thu, 17 Sep 2020 09:14:09 -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=hL1cKoF+; 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 S1727867AbgIQPOk (ORCPT + 99 others); Thu, 17 Sep 2020 11:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbgIQPL0 (ORCPT ); Thu, 17 Sep 2020 11:11:26 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E28ABC06178B; Thu, 17 Sep 2020 08:10:54 -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=MTLlKe719mgAVscm2w1Ql0nN7cIRPfZQnUskn6+25OA=; b=hL1cKoF+6/UAQwKZIfKnU0NZqr 5yu8M7+7C5AX6w2ZPJR/qCXtNh7fJv27Z77Vzg8+rgPWUUAccXm6tDAc3RAjURPkde7Zqjc5//Z0p 46Fkcm7nzOM2P9Av5IqEb5DBysNZXaLpSIFI0VmfJzpsEzy4k1mlNLIFBwXItEIIMuEfqHOhCFmD6 N9w4+E/bGdCcr5t/UEf/772f/WOi+W3pu/0ob1SVwmgYAGtuCpTkHyVzp2Eii+eUkpm7Y2RVYO8Jh weQ8jbJAdSxLrmFKCtZL5WTufs7vOcOru0MJvs/IwIS8jD/oQYRu/fi5yOyFxJl0fkYD/uFdDqAe/ Mdqo87Jg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYi-0001Pa-Tk; 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 04/13] ceph: Tell the VFS that readpage was synchronous Date: Thu, 17 Sep 2020 16:10:41 +0100 Message-Id: <20200917151050.5363-5-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 ceph readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ceph/addr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6ea761c84494..b2bf8bf7a312 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -291,10 +291,11 @@ static int ceph_do_readpage(struct file *filp, struct page *page) static int ceph_readpage(struct file *filp, struct page *page) { int r = ceph_do_readpage(filp, page); - if (r != -EINPROGRESS) - unlock_page(page); - else - r = 0; + if (r == -EINPROGRESS) + return 0; + if (r == 0) + return AOP_UPDATED_PAGE; + unlock_page(page); return r; } -- 2.28.0