[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190902144303.GF2664@architecture4>
Date: Mon, 2 Sep 2019 22:43:04 +0800
From: Gao Xiang <gaoxiang25@...wei.com>
To: Christoph Hellwig <hch@...radead.org>
CC: Gao Xiang <hsiangkao@....com>, Jan Kara <jack@...e.cz>,
Chao Yu <yuchao0@...wei.com>,
Dave Chinner <david@...morbit.com>,
LKML <linux-kernel@...r.kernel.org>,
Miao Xie <miaoxie@...wei.com>, <devel@...verdev.osuosl.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Amir Goldstein <amir73il@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Theodore Ts'o <tytso@....edu>, Pavel Machek <pavel@...x.de>,
David Sterba <dsterba@...e.cz>,
Li Guifu <bluce.liguifu@...wei.com>,
Fang Wei <fangwei1@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
<linux-fsdevel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
<linux-erofs@...ts.ozlabs.org>
Subject: Re: [PATCH v6 03/24] erofs: add super block operations
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
Powered by blists - more mailing lists