Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7728901ioo; Fri, 3 Jun 2022 12:11:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb3X6IPrAjDmui9ihPP5q+qIZqyftq4VA6mfa8xWDrgNj1jFUZQfiHhJrBc3cR3X7jHXmz X-Received: by 2002:a05:6402:b3b:b0:42b:fbec:7807 with SMTP id bo27-20020a0564020b3b00b0042bfbec7807mr12693165edb.420.1654283508783; Fri, 03 Jun 2022 12:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654283508; cv=none; d=google.com; s=arc-20160816; b=xJ1Fh2IkW/13gt3tr8dWCP/paQ5OsU8J4Kz3Nd0NmN8ouPcRZminOqhIsMdRJvJwvH J6xTbd0uTDV4lmeOlmlHeTYR0EDXnQ7JO00ikUdopCfbA35kRXKs9j6JSdJUT37eERro RA8rBRk9tTk6896noxLcjzzk1Z5UY3Vj0ewGn8m9UOaSDKuubw80kwUcVqJx4jm+I6/G mmU6N0+bQmn9IBrxBd1KayeE+I7D833MXYMyRoFtsgrkMnncOl4oNoJUqF1yx+PehCZq ojhj3bRLv4BNKm5QcWLXx2s+8SEYHOv8IStIKDoUoU6eRhWgoFH1Wk8+mtq5dKdwA5lW +scA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aUeh3TS7yGsWjasgaqZC24BFaRSUEZ62WTQKuLG/trQ=; b=VOPAoDvzTRNAqU7jtvOjuO2Y8m29xUf7UfYnKRLTPch09JgiftzTvcUTAAZR/ABUwl 0CvTf8Nc6bEmw+JmzsOwIX2cdG2i8qv4KgeNGqi0sTN7SXyaq2XM+ziVC4TfQ8RNrZqI 158YvXBspbilXOWkMuMBtvb+8Xx6jjdQC7ZTa8c3A+7jyjO3LfOkqn+gA6KRUBqWpWPZ zqk+JM7J2H+Bvjf9Sqirtb7kURxMbkDSvtTSRei72pzBZUEQEOgi09Jh1iEOw+GusNX0 WJQlxZYAPknL9sqVwS6AjjxxAvzDLEWeNb10kRpGDbRulupTuw1zHC9ieAiAIAWDRkTo jAbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rqpqty5t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a170906794e00b006fddafc5e3fsi245149ejo.560.2022.06.03.12.11.16; Fri, 03 Jun 2022 12:11:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rqpqty5t; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241157AbiFCOkT (ORCPT + 99 others); Fri, 3 Jun 2022 10:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236288AbiFCOkS (ORCPT ); Fri, 3 Jun 2022 10:40:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4EC48E59; Fri, 3 Jun 2022 07:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aUeh3TS7yGsWjasgaqZC24BFaRSUEZ62WTQKuLG/trQ=; b=Rqpqty5tCsq2jB3TvZzzfKJD4l pb5a7z5ruClsgoUHFfwNxqUKUN7YcBdi3NZa/hveC9iQzmuYkjH0B3pmL8lxBtYU0Q46iJTLOFAl6 IKeRglu339/99NOmrlt8avDqhCgseACC1zojteE6QfkjcOU18GFeCnUJV2JPGRHNhlyGcNfs27K79 K8dfWfy9vvXs7/clYWfepxLhev3B0XaWxE/DPMY6hIldB38pXsEtbm2AjBdQK1GigomlRu4+ahAQZ SyrgT37FNKsOkuzfHBbjQt8Gl2lPaqd+tJ4eivbFAuFBeSGZVbazqTxsocDxIyjLnxq+6TppM0hZ5 Ql0o3aOw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx8TF-007xAb-Kc; Fri, 03 Jun 2022 14:40:13 +0000 Date: Fri, 3 Jun 2022 15:40:13 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: jfs-discussion@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , linux-ext4@vger.kernel.org, Jan Kara Subject: generic_quota_read Message-ID: References: <20220526192910.357055-1-willy@infradead.org> <20220526192910.357055-8-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, May 26, 2022 at 10:43:51PM -0700, Christoph Hellwig wrote: > > static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data, > > + size_t len, loff_t pos) > > And this whole helper is generic now. It might be worth to move it > into fs/quota/dquot.c as generic_quota_read. I've been working on that this week. Unfortunately, you have to convert both quota_read and quota_write at the same time, it turns out. At least ext4_quota_write() uses the bdev's inode's page cache to back the buffer_heads, so quota_read() and quota_write() are incoherent with each other: 00017 gqr: mapping:00000000ee19acfb index:0x1 pos:0x1470 len:0x30 00017 4qw: mapping:000000007f9a811e index:0x18405 pos:0x1440 len:0x30 I don't know if there's a way around this. Can't really use read_mapping_folio() on the bdev's inode in generic_quota_read() -- the blocks for a given page might be fragmented on disk. I don't know if there's a way to tell ext4_bread() to use the inode's page cache instead of the bdev's. And if we did that, would it even work as being part of a transaction?