Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp670797pxk; Thu, 17 Sep 2020 12:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySMX6vuj6uN5FxOxMa2tq9nj0ymq/H7WA0DUZT0yB9B0wWShHDDUY7o2+ypC0QKcJ5wp9r X-Received: by 2002:aa7:c053:: with SMTP id k19mr34281534edo.326.1600372613557; Thu, 17 Sep 2020 12:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600372613; cv=none; d=google.com; s=arc-20160816; b=apD3yQR+V4MiWPldb75tXfIjwteJknB3ggdJ0ViuRUAs5IiIXH/pkPfXm2AqGmEYED zDE3NiVOwmgajDSWz47d2jXc0QRJvr8L3h8pLut50gTsPtbGnKN82qKgQrfuLB0oxjIt hSFVCXIaGjWyM3ODIN66qPNcGCZd5dVwjUiY7F8qeu3BFoKZbv41Bsd6Rjmu6K2V9Fis n94N4gkrFHwIOc+c40ppvbNoD4z3ACOwUd7Tuq9OweRsGL62F/ic120ufnUguWsfMKd7 Eefp1OBFw2BZurEuyUuGFsnCGslRnhadZv/xpRpf9DVAYBocawhK3HVOgDn9yJ8Ryoie 4n+w== 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=jmv1iA6ONHdhBCtewTigT8o0CWZcxoZXOX5KqmVgnTU=; b=bOgdnF5+obXlJ2Z9jYuQ15oouBWpx5pVveM94LzJrdlWnQiGw+SVRPhdPwkkvnb61x DoGnK/+/Asiw3aHipqiyBEA5cbmZcGa5pJvRjZwpz8MJEkEpZ0ddu10MlrnjtOANQINV MSpUukpJU/DPqDfiPGgIhjAwEu/G261GBc0RzmF22LFg5EtWPFsI5RzPWpD8/j+lWanH ctJ435lkrlaGthRUaDA8vWGCA3dHGUve1gX+h0r9vo26CjcZR45a2ZaCoIUG4ogCf0sg 77w4XGxdKPJ+2aDTSHoH0Rr5fLxo15DIlzX1PRw1XLjLXEdOvmjnrXFsBikfRxb5VNnp VvPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UY+WWn03; 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 p18si683476ejd.537.2020.09.17.12.56.29; Thu, 17 Sep 2020 12:56:53 -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=UY+WWn03; 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 S1728003AbgIQPNE (ORCPT + 99 others); Thu, 17 Sep 2020 11:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727913AbgIQPL1 (ORCPT ); Thu, 17 Sep 2020 11:11:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D00CC061351; Thu, 17 Sep 2020 08:10:55 -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=jmv1iA6ONHdhBCtewTigT8o0CWZcxoZXOX5KqmVgnTU=; b=UY+WWn03vEnSCFKL2cQHuVM2i1 QWe+kigsY5nChj3dZW/h0aA6t4GCygWRYiPrbLnPJyTb6ae0uBq7cwL0EVmUXxakpgq2oapyhxDVe kBTCeumlVxnjVbvMWT8TED6H5Lcw3uow0f5XM1VjF7pOlh95YVKHtIN/5KguGYPRny3fc7WmToepE 6Jv3+/5X4HTO12zMC+BPVGhiLP9iGEug/FLiAS+EZQ5RUi5fhnhqUz6TLDBMJmQh4+piAUkJgSqEP GBPJGhPkoKX4qDNExrVMjUWBmj38ZJGRM5eAJLVtOUR4LK3uM6CBTW568DQXcnfRhTgPg5qDs7lV7 kS4OBj7Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYj-0001Pz-KI; Thu, 17 Sep 2020 15:10:53 +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 07/13] ecryptfs: Tell the VFS that readpage was synchronous Date: Thu, 17 Sep 2020 16:10:44 +0100 Message-Id: <20200917151050.5363-8-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 ecryptfs readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ecryptfs/mmap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index 019572c6b39a..dee35181d789 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c @@ -219,12 +219,13 @@ static int ecryptfs_readpage(struct file *file, struct page *page) } } out: - if (rc) - ClearPageUptodate(page); - else - SetPageUptodate(page); - ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16lx]\n", + ecryptfs_printk(KERN_DEBUG, "Returning page with index = [0x%.16lx]\n", page->index); + if (!rc) { + SetPageUptodate(page); + return AOP_UPDATED_PAGE; + } + ClearPageUptodate(page); unlock_page(page); return rc; } -- 2.28.0