Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp492724pxk; Thu, 17 Sep 2020 08:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMwJsgNWDBehCw+rwOBYvx6U0864Sqw0nlGJ8gAKniySG09DJZJ9zKVhU97oSRZB2ozfHg X-Received: by 2002:a17:906:fb8f:: with SMTP id lr15mr30672731ejb.25.1600356122772; Thu, 17 Sep 2020 08:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600356122; cv=none; d=google.com; s=arc-20160816; b=UrGDQCMzjfOfH4dYrnC8wJxy0WMRcT3OmJvVyEVa2UrAmslbR/B98rxHtAwbDHc9FL a3ziV5mDeJDg0R3XKqCW5/hOhWxebyffyEsENKdGyNEC1PqZdslW3i8KCkIDykfIwAC5 +APs7NMI/VI7dU5kjGQnF+Bm9IBOlhsxaVbzzvc9Vqb1yxEDVRa6S4pjXMO/WmlI7u22 zelEZs1H5UDDah93Nlj1Uiul1I0UC3unBNOeqXdDc37IV19FZvScRKDvjyeikjDgrpn9 b6N6TeM0H9mpxj07QMSUThh/9hNvemf9k/S3Cnaim0sM+n0mbFPHxdoY+RC/aIVJTFlA rvfA== 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=TQBRqWssafAKvwIvR7lzoo8RTexMgQj7fs6uGmXDbG8=; b=Xrxg16T5J8gBxAUyWPUzoWqL3telgpMOyzOm+Vqf3kZ89J1fMTaaRRONOBcQy5XhIf t/60oKlZlLWZv27jzgoUU+DKw6JWH+M+B9mgLr24XBkIqQC44miFpcHE559JhdONKNXE JCW4BbEZfA+hZ7i314TMF2s027hIt0aRyGfS91DdPi2krtUQl5NYirQIC7kSRPw8X7/z 9ybFv/KVVYguknygyMAKdqO5zP3sSB8MJNi1rzHYSCRxj39FAyZgcrwg0H8lbmkTYr7g BdvAF+vPT2DolwzIiNBupzQB6iZvDlLA7SHzsnhImyQcNK6Jx5KELUJA+XaKa2MuJ5wH xUmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PWcESTBi; 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 bg10si76757ejb.534.2020.09.17.08.21.38; Thu, 17 Sep 2020 08:22:02 -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=PWcESTBi; 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 S1728122AbgIQPRX (ORCPT + 99 others); Thu, 17 Sep 2020 11:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727957AbgIQPLm (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 75C18C061355; 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=TQBRqWssafAKvwIvR7lzoo8RTexMgQj7fs6uGmXDbG8=; b=PWcESTBi2QdFaDtr4Kt4N/34ol BZucpvpLRkXa8ZU6jmD4/MNNLdyhI6jq5RGlNTI+7cnzljsph3vSv41tMVFaVCuJIHKVGvhq55luG VlKI5YbiFVjYmZ/qgUqOPSk4Yl0dl1Ln9m5wBGeqTKDvgoCPiT+zzvkxueQRDkSyz3EC1K9dn47WL kL6JV4gWpaD8ac6bg11qRxZ0MfeMh/aZXfmsm2qLkzbMN63JIgC+PaZTertM1qoVbnCZcRj8jkGpj mbA7mK4MZ+XfiRsIEsh0b5A1JSx6Be74RHIPWHSYBJAeBWSiDibZWQB0PH34/c3NQ3vpisiBqN2aV nyhyeVyQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYk-0001QZ-Ok; 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 11/13] ubifs: Tell the VFS that readpage was synchronous Date: Thu, 17 Sep 2020 16:10:48 +0100 Message-Id: <20200917151050.5363-12-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 ubifs readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ubifs/file.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index b77d1637bbbc..82633509c45e 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -772,7 +772,6 @@ static int ubifs_do_bulk_read(struct ubifs_info *c, struct bu_info *bu, if (err) goto out_warn; - unlock_page(page1); ret = 1; isize = i_size_read(inode); @@ -892,11 +891,16 @@ static int ubifs_bulk_read(struct page *page) static int ubifs_readpage(struct file *file, struct page *page) { - if (ubifs_bulk_read(page)) - return 0; - do_readpage(page); - unlock_page(page); - return 0; + int err; + + err = ubifs_bulk_read(page); + if (err == 0) + err = do_readpage(page); + if (err < 0) { + unlock_page(page); + return err; + } + return AOP_UPDATED_PAGE; } static int do_writepage(struct page *page, int len) -- 2.28.0