Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp664072pxk; Thu, 17 Sep 2020 12:43:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLdvjTTuXWU+DTcN8prGW/GrViIvoQREP7AyOW6krr0MCS4DXmsuPmaPzwOjp7qBdJjx0l X-Received: by 2002:a17:907:3301:: with SMTP id ym1mr34158054ejb.367.1600371818369; Thu, 17 Sep 2020 12:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600371818; cv=none; d=google.com; s=arc-20160816; b=ZfTH+WwZCJAY1PenkOGmBY90HZQmJGyajfNkhlLIH779iR7iep9Q62iL4G4G/LYsem aGbC4uC3RogZTEjtrKm9/73zHx12X6f5GhhBFqly22cGfPErbtvgg4azykqwWp1rwPUo fVJ2OD9OtI5+aM0hOT69QW/dWU8gTMnssR1ctHouq48GSnPZPYEjw0ZxCNcnE1BswsZg 0krVtQaMAeitCWemAmzLmj0WUQrKxWruKmRGCnzfZmFGudrId5wTlkPxis80IWRVsvv4 2VINoKOnkqvEZSMoCfRGbJMxUFdVfpHKtOUAfzQ/zTuSZM+9vekGZUOIhlASwtdo7RFI yFqw== 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=zAZy51PVGFxs64ScUkLAAfIGOTINfzCY3cwZ6yg8A5Q=; b=QKCsIQFfokt7IPm/lZOEtyGuuOaZpHCvVsJkMirL8BJCouSxaywQmy69lXQeCQgGmF rxmf3eGGlkLA5MnXnOjbjmMGbPj+M/FV95f40PMNIkcUGCUcGRRBS59esTQWcjQd3FA+ gUl3mYQJ9UQOomLzPxJzbQtD/2xYp1/DhopY5rEHcyY/HfGLSXtRLMeM6r3zT5DO+euH blCyK6bIKByHftm7lOQI9Xy88lJGfFuj7T9I+iDM4m4KvSP52mYLi30rd+dX0G4jdIHf JkWMtny/IGVFgEACK149FfJ6qPILDxJhEOsRKVKvqXb/9gR+zhL5iKzgfKE5nlcfQccQ 4Ivg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rNkQQL23; 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 mc20si627322ejb.571.2020.09.17.12.42.43; Thu, 17 Sep 2020 12:43:38 -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=rNkQQL23; 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 S1727946AbgIQPTT (ORCPT + 99 others); Thu, 17 Sep 2020 11:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727956AbgIQPLm (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 66827C061354; Thu, 17 Sep 2020 08:10:56 -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=zAZy51PVGFxs64ScUkLAAfIGOTINfzCY3cwZ6yg8A5Q=; b=rNkQQL233o1qC43qgzc5gAcwW0 JWxbRmm2ZfIwaHZhsWpFEKH6URvvGnOl1lWpFGP1nYY0Sqr7ijYVsrYUtJkFiSonlGtRJl6cimgyP lDLV4gyAydyEpflI+vQZ4wM9tquamB9lVliU76d1jfrLZ3AZAK1nSIlPRXGCk+Ogknuo6rL6Fg0xy L1asspYZzWlUYbQnnTCDsrSYurULC6YWIxRKHcIflFNXXfqW5r/+hTUi1w8a8PEiaXpPlez6I5SbS NPlMlq+FCbmcCu9y8afa0VyqlkfmuaoZLWu95P043ThRs5XDJ3LySRaf0uovI42Oq1qtLiMaK/SK0 RnSxJNWg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYk-0001QP-FF; Thu, 17 Sep 2020 15:10:54 +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 10/13] jffs2: Tell the VFS that readpage was synchronous Date: Thu, 17 Sep 2020 16:10:47 +0100 Message-Id: <20200917151050.5363-11-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 jffs2 readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/jffs2/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index f8fb89b10227..959a74027041 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -116,15 +116,17 @@ int jffs2_do_readpage_unlock(void *data, struct page *pg) return ret; } - static int jffs2_readpage (struct file *filp, struct page *pg) { struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host); int ret; mutex_lock(&f->sem); - ret = jffs2_do_readpage_unlock(pg->mapping->host, pg); + ret = jffs2_do_readpage_nolock(pg->mapping->host, pg); mutex_unlock(&f->sem); + if (!ret) + return AOP_UPDATED_PAGE; + unlock_page(pg); return ret; } -- 2.28.0