Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4029178pxv; Mon, 26 Jul 2021 19:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwu3Lth75Wyauh1U4/+vg1KnkJrBhU+fik0odMbe1J49oVQ+7wxOEjX1x8RHBcY8czpqq0 X-Received: by 2002:a05:6638:289:: with SMTP id c9mr19546703jaq.14.1627351623067; Mon, 26 Jul 2021 19:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627351623; cv=none; d=google.com; s=arc-20160816; b=sIiV4I6yLTHxSccJ4lwSLWLmY2DCAibAlEfa+mfnr3OVkjASBrR0T5vXubraj88FU3 S6kBU0ZQCDtZAyE/WEUh7hupxkYK3G736oQai2xjwp1qwmVZjHlk45LT8nHa1tS2jfRD I4Bsx4D304pmTxrRJQW8sLfR/K2bmnbdxVkkUEyk6OWZD2cVrH9nl0y12ME5CLdiSoEL KjxI6VLHmRju0vUVImDWRz0ovUcZ3A6LhQxxlAHxt9fy3EQ1CHe0nFyM0dfwkS583hO9 tZgehWCuNs2+punlnK3Zk2tWPNz/6LeYI81HRAcF/TebXJ6pHYdwTCGei+cpQMgy4kT/ SbTQ== 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=V0ATl+eIh0HuiypTyuL38sNzso+AG9tCEbfF0CNjqqM=; b=X0l9j2o/vLHXDbZyg0iGxs+zOEyCZDLZyr5CulIpjN5HdIXzlrN90td3U6sOhFNQNV a/t/QN7n7+ryvG0UTWtfRg5wG59gvDN62zgHrTbglizXGDs/Qk09WHUOvQ9jovOCNQ3L A3rSjpH79iJXgn9qsmhctv4pYgkEJmwrgSKBmpG2slFwVDrO0b4wQXgBjade4bIAsIbp 8S5BSfEfoNaNsqylvxvDgkYzQpHDayIcGG5xiCDLyP2l2oNUDv0qNTgZzCDG2r9H5Lc1 hgLqW22uMltaKFsm2udFDF++s6fAxcgusIDNTnAfkpEkwyG+DMqSw52i3Rpiqe1sW2zL grIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=unyefSVZ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 a10si1767114ilv.72.2021.07.26.19.06.40; Mon, 26 Jul 2021 19:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=unyefSVZ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234419AbhG0B0E (ORCPT + 99 others); Mon, 26 Jul 2021 21:26:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbhG0B0D (ORCPT ); Mon, 26 Jul 2021 21:26:03 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF4BC061757; Mon, 26 Jul 2021 19:06:31 -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=V0ATl+eIh0HuiypTyuL38sNzso+AG9tCEbfF0CNjqqM=; b=unyefSVZ6q91OKI3QKjtdVxX7K bOZtKgxWnX4ShhE+mwfNAkHi+rfDnWczn5QB2a7UlkkiMzNHsxzuEGGFI9jDjScwVSg/dLxGhJNAH y6FDtCpt55JJlmHtjMd2pDKYOpOU5QdJC6Bta/hMqixP7gH6Paij1bsyOOIzNnzgytJ7aZi/iuH8h KlRpJCIAPYnsK464AaujXWchz+xg36bMNkv/Kd+YlM/+5IVwwN7+gDbR6dywCkhE3cHA8i6wi1WEU UEmr9aGtnqUUpqYf30O/yQNKEEz/bdQ1mCRG33fCpmw6XljCg4OSUIr7O+/J8xVyOahbR+m4mBHcL uz+Zfw0Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8CTR-00EZdj-0O; Tue, 27 Jul 2021 02:06:00 +0000 Date: Tue, 27 Jul 2021 03:05:36 +0100 From: Matthew Wilcox To: NeilBrown Cc: Goldwyn Rodrigues , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH] fs: reduce pointers while using file_ra_state_init() Message-ID: References: <20210726164647.brx3l2ykwv3zz7vr@fiona> <162733718119.4153.5949006309014161476@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162733718119.4153.5949006309014161476@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jul 27, 2021 at 08:06:21AM +1000, NeilBrown wrote: > You seem to be assuming that inode->i_mapping->host is always 'inode'. > That is not the case. Weeeelllll ... technically, outside of the filesystems that are changed here, the only assumption in common code that is made is that inode_to_bdi(inode->i_mapping->host->i_mapping->host) == inode_to_bdi(inode) Looking at inode_to_bdi, that just means that they have the same i_sb. Which is ... not true for character raw devices? if (++raw_devices[minor].inuse == 1) file_inode(filp)->i_mapping = bdev->bd_inode->i_mapping; but then, who's using readahead on a character raw device? They force O_DIRECT. But maybe this should pass inode->i_mapping->host instead of inode. > In particular, fs/coda/file.c contains > > if (coda_inode->i_mapping == &coda_inode->i_data) > coda_inode->i_mapping = host_inode->i_mapping; > > So a "coda_inode" shares the mapping with a "host_inode". > > This is why an inode has both i_data and i_mapping. > > So I'm not really sure this patch is safe. It might break codafs. > > But it is more likely that codafs isn't used, doesn't work, should be > removed, and i_data should be renamed to i_mapping. I think there's also something unusual going on with either ocfs2 or gfs2. But yes, I don't understand the rules for when I need to go from inode->i_mapping->host.