From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 969C3C433DF for ; Fri, 16 Oct 2020 16:20:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1BF9B20848 for ; Fri, 16 Oct 2020 16:20:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kYJP+mEh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BF9B20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9AE93940013; Fri, 16 Oct 2020 12:20:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 936F3940012; Fri, 16 Oct 2020 12:20:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FFD3940013; Fri, 16 Oct 2020 12:20:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id 4CAC1940012 for ; Fri, 16 Oct 2020 12:20:47 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B69F9181AEF1E for ; Fri, 16 Oct 2020 16:20:46 +0000 (UTC) X-FDA: 77378302092.20.foot16_3a01bd02721e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 9855A180C07A3 for ; Fri, 16 Oct 2020 16:20:46 +0000 (UTC) X-HE-Tag: foot16_3a01bd02721e X-Filterd-Recvd-Size: 2829 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 16:20:46 +0000 (UTC) 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=s32aG3TT8gSwa4wk3wTFOPbSLlkdVuiNeRF4/gWWj4Y=; b=kYJP+mEhXaySepAsFUmQIeV8kp kGNml2aZBoFVfYFfCNqhW0+z3COGlN3stBsKtQqVq9/5NKsLty62Y4PflaVvmkdPiPCL6hHYA6z2t QW/kxIDecHDrFxAvqwxMvW8c0jtOzOyuSeMlScK5lsI0ctJ2iquLYZ5m0knTCC6n7d6c9w1HPnzzS EWFlHJCejUJ4jKeDxyOsGwV4aj3ahhL/15+qsjkxyjzhfSwG+M9Zo4kuq4eoUO1jtFVKWFi0UUdtp XsI+4cusgzvSla2AGVf883MwzMe571jgIv15eSN4IvMbqSE+NAFhU5O2owBc+at6Ggsg2ZdD6f5so kcnLkisw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTSDn-0004tT-S2; Fri, 16 Oct 2020 16:04:47 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org Subject: [PATCH v3 11/18] ext4: Tell the VFS that readpage was synchronous Date: Fri, 16 Oct 2020 17:04:36 +0100 Message-Id: <20201016160443.18685-12-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201016160443.18685-1-willy@infradead.org> References: <20201016160443.18685-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The ext4 inline data readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/inline.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 75c97bca0815..2a489243e4de 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -490,7 +490,8 @@ static int ext4_read_inline_page(struct inode *inode,= struct page *page) zero_user_segment(page, len, PAGE_SIZE); SetPageUptodate(page); brelse(iloc.bh); - + if (ret >=3D 0) + return AOP_UPDATED_PAGE; out: return ret; } @@ -514,12 +515,14 @@ int ext4_readpage_inline(struct inode *inode, struc= t page *page) else if (!PageUptodate(page)) { zero_user_segment(page, 0, PAGE_SIZE); SetPageUptodate(page); + ret =3D AOP_UPDATED_PAGE; } =20 up_read(&EXT4_I(inode)->xattr_sem); =20 - unlock_page(page); - return ret >=3D 0 ? 0 : ret; + if (ret < 0) + unlock_page(page); + return ret; } =20 static int ext4_convert_inline_data_to_extent(struct address_space *mapp= ing, --=20 2.28.0