Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp690627ybe; Mon, 2 Sep 2019 07:45:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzTTBL6ySuSRCVKf2d5fQ2L4kvJ2KqXBiehvTK1vbMX5+BcDEberJK5YULaMHgXas5LkOi X-Received: by 2002:a17:902:8f95:: with SMTP id z21mr30332605plo.42.1567435518911; Mon, 02 Sep 2019 07:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567435518; cv=none; d=google.com; s=arc-20160816; b=zznXSrJPlIeJcz9hKa+eRrO0ikEvDgl0MnQ5gxGHKj5Gn4EMLb+wojjTuMhmvhJ4G6 BcAGWvAWjjer21liesgBqR35s0Qbcal9yL9KnTb0V4meTDhwPT3vuwkvpIoJ4P4ZBOEk lYN5t3+juHf1xPw1gkqFG+SEvE7YussKvnULLrWGhig3MiE/+Dz+0ucNaR9SaI4vVzF1 J4McR+T4L4WKUujbZDy16xbOvvqO0SrG+/AeyJdsH79xRvjIqgYT27Ew9iym86YxR6KE WE0TymRNwNk3n4eJpMeiuVRWO9Yg0SQnUkV1sWKbkV3H/6qo9OfP7zn1cyCsUmu6oTey +ezw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rJ/Yy/PMgiYN8qgeHuABUMZ3WpSpuDMAP5evvkpCHTo=; b=w7loKiDz7lY1SpVg08WKZKAKwTxxiKT5XJiAaTyMsgnwi47TeELua9ccBuwln5gKti F6GjyMfpfwh6GQTyWGar6E4+JPwy0NhYNA1/uAs8dq0/uPgILzhmdu0NnY1WW5wKhjD9 wtDTVcUfk7CeNU/w+yjsHiP0Hd2+rAu7lbSZJ6a1AM9IUjSzc5NtmLDoOPAesWT1QEYG i/BiImkWwNmci+XVxh3RGdKgTfDdWoKhjSBMA/9vsBR2GuygQ0gTNfUKWCgcXAOhtfpz yjyUMNh44/do4kcGAAPIPahIjgYBso+GvzTVl9cg/CpxbHCLrsBjMiobLCRSci5ExhhR s/tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si10349727plb.101.2019.09.02.07.45.03; Mon, 02 Sep 2019 07:45:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731666AbfIBOoM (ORCPT + 99 others); Mon, 2 Sep 2019 10:44:12 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:4405 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726382AbfIBOoL (ORCPT ); Mon, 2 Sep 2019 10:44:11 -0400 Received: from DGGEMM406-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 58F3A420F300ACFA4260; Mon, 2 Sep 2019 22:43:56 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM406-HUB.china.huawei.com (10.3.20.214) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Sep 2019 22:43:55 +0800 Received: from architecture4 (10.140.130.215) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 2 Sep 2019 22:43:55 +0800 Date: Mon, 2 Sep 2019 22:43:04 +0800 From: Gao Xiang To: Christoph Hellwig CC: Gao Xiang , Jan Kara , Chao Yu , Dave Chinner , LKML , Miao Xie , , Stephen Rothwell , "Darrick J . Wong" , Linus Torvalds , Amir Goldstein , Alexander Viro , Jaegeuk Kim , Theodore Ts'o , Pavel Machek , David Sterba , Li Guifu , Fang Wei , Greg Kroah-Hartman , , Andrew Morton , Subject: Re: [PATCH v6 03/24] erofs: add super block operations Message-ID: <20190902144303.GF2664@architecture4> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-4-gaoxiang25@huawei.com> <20190829101545.GC20598@infradead.org> <20190901085452.GA4663@hsiangkao-HP-ZHAN-66-Pro-G1> <20190902125109.GA9826@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190902125109.GA9826@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme706-chm.china.huawei.com (10.1.199.102) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On Mon, Sep 02, 2019 at 05:51:09AM -0700, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 04:54:55PM +0800, Gao Xiang wrote: > > No modification at this... (some comments already right here...) > > > 20 /* 128-byte erofs on-disk super block */ > > 21 struct erofs_super_block { > > ... > > 24 __le32 features; /* (aka. feature_compat) */ > > ... > > 38 __le32 requirements; /* (aka. feature_incompat) */ > > ... > > 41 }; > > This is only cosmetic, why not stick to feature_compat and > feature_incompat? Okay, will fix. (however, in my mind, I'm some confused why "features" could be incompatible...) > > > > > + bh = sb_bread(sb, 0); > > > > > > Is there any good reasons to use buffer heads like this in new code > > > vs directly using bios? > > > > As you said, I want it in the page cache. > > > > The reason "why not use read_mapping_page or similar?" is simply > > read_mapping_page -> .readpage -> (for bdev inode) block_read_full_page > > -> create_page_buffers anyway... > > > > sb_bread haven't obsoleted... It has similar function though... > > With the different that it keeps you isolated from the buffer_head > internals. This seems to be your only direct use of buffer heads, > which while not deprecated are a bit of an ugly step child. So if > you can easily avoid creating a buffer_head dependency in a new > filesystem I think you should avoid it. OK, let's use read_mapping_page instead. > > > > > + sbi->build_time = le64_to_cpu(layout->build_time); > > > > + sbi->build_time_nsec = le32_to_cpu(layout->build_time_nsec); > > > > + > > > > + memcpy(&sb->s_uuid, layout->uuid, sizeof(layout->uuid)); > > > > + memcpy(sbi->volume_name, layout->volume_name, > > > > + sizeof(layout->volume_name)); > > > > > > s_uuid should preferably be a uuid_t (assuming it is a real BE uuid, > > > if it is le it should be a guid_t). > > > > For this case, I have no idea how to deal with... > > I have little knowledge about this uuid stuff, so I just copied > > from f2fs... (Could be no urgent of this field...) > > Who fills out this field in the on-disk format and how? mkfs.erofs, but this field leaves 0 for now. Is that reasonable? (using libuuid can generate it easily...) > > > The background is Al's comments in erofs v2.... > > (which simplify erofs_fill_super logic) > > https://lore.kernel.org/r/20190720224955.GD17978@ZenIV.linux.org.uk/ > > > > with a specific notation... > > https://lore.kernel.org/r/20190721040547.GF17978@ZenIV.linux.org.uk/ > > > > " > > > OTOH, for the case of NULL ->s_root ->put_super() won't be called > > > at all, so in that case you need it directly in ->kill_sb(). > > " > > Yes. Although none of that is relevant for this initial version, > just after more features are added. This patch uses it actually... since no failure path in erofs_fill_super() and s_root will be filled nearly at the end of the function... Thanks, Gao Xiang