From: Johannes Thumshirn <jthumshirn@suse.de>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH RFC] fs: New zonefs file system
Date: Fri, 12 Jul 2019 10:47:18 +0200 [thread overview]
Message-ID: <20190712084718.GB16276@x250.microfocus.com> (raw)
In-Reply-To: <BN8PR04MB581241A65E81F79882508F4BE7F20@BN8PR04MB5812.namprd04.prod.outlook.com>
On Fri, Jul 12, 2019 at 08:31:32AM +0000, Damien Le Moal wrote:
[...]
> > I know I've been advocating for having on-disk metadata, but do we really
> > sacrifice a whole zone per default? I thought we'll have on-disk metadata
> > optional (I might be completely off the track here and need more coffee to
> > wake up though).
>
> Yes, indeed we do not really need the super block for now. But it is still super
> useful to have so that:
> 1) libblkid and other such userland tools can probe the disk to see its format,
> and preserve the usual "use -force option if you really want to overwrite"
> behavior of all format tools.
> 2) Still related to previous point, the super block allows commands like:
> mount /dev/sdX /mnt
> and
> mount -t zonefs /dev/sdX /mnt
> to have the same result. That is, without the super block, if the drive was
> previously formatted for btrfs or f2fs, the first command will mount that old
> format, while the second will mount zonefs without necessarily erasing the old
> FS super block.
> 3) Having the super block with a version number will allow in the future to add
> more metadata (e.g. file names as decided by the application) while allowing
> backward compatibility of the code.
>
> >> + end = zones + sbi->s_nr_zones[ZONEFS_ZTYPE_ALL];
> >> + for (zone = &zones[1]; zone < end; zone = next) {
> >
> > [...]
> >
> >> +
> >> + /* Set defaults */
> >> + sbi->s_uid = GLOBAL_ROOT_UID;
> >> + sbi->s_gid = GLOBAL_ROOT_GID;
> >> + sbi->s_perm = S_IRUSR | S_IWUSR | S_IRGRP; /* 0640 */
> >> +
> >> +
> >> + ret = zonefs_read_super(sb);
> >> + if (ret)
> >> + return ret;
> >
> > That would be cool to be controllable via a mount option and have it:
> > sbi->s_uid = opt.uid;
> > sbi->s_gid = opt.gid;
> > sbi->s_perm = opt.mode;
> >
> > or pass these mount options to zonefs_read_super() and they can be set after
> > the feature validation.
>
> Yes, I thought of that and even had that implemented in a previous version. I
> switched to the static format time definition only so that the resulting
> operation of the FS is a little more like a normal file system, namely, mounting
> the device does not change file attributes and so can be mounted and seen with
> the same attribute no matter where it is mounted, regardless of the mount options.
[...]
> > I'd rather not write the uid, gid, permissions and startsect name to the
> > superblock but have it controllable via a mount option. Just write the feature
> > to the superblock so we know we _can_ control this per mount.
>
> This is another view. See my thinking above. Thoughts ?
Hm, both a valid views and I'm not sure which is better for the production use
cases either.
With the approach I had in mind one could pre-format dozens of drives and
deploy them in the field. The admins then can decide what
UID/GID/Permission/etc.. the application layer needs for a particular drive
and supply these parameters on mount time.
With the approach you implemented here we don't have the surprises if someone
accidentally (or maliciously) passed the wrong parameters.
A combined approach is also not 100% discussion free, as what has preference,
on-disk or mount time.
I'll be thinking about it and come back once I have an idea.
Byte,
Johannes
--
Johannes Thumshirn SUSE Labs Filesystems
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
next prev parent reply other threads:[~2019-07-12 8:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 3:00 [PATCH RFC] fs: New zonefs file system Damien Le Moal
2019-07-12 8:00 ` Johannes Thumshirn
2019-07-12 8:31 ` Damien Le Moal
2019-07-12 8:47 ` Johannes Thumshirn [this message]
2019-07-12 17:10 ` Viacheslav Dubeyko
2019-07-12 22:56 ` Damien Le Moal
2019-07-15 16:54 ` Viacheslav Dubeyko
2019-07-15 23:53 ` Damien Le Moal
2019-07-16 16:51 ` Viacheslav Dubeyko
2019-07-18 0:57 ` Damien Le Moal
2019-07-15 1:19 ` Dave Chinner
2019-07-15 6:57 ` Johannes Thumshirn
2019-07-16 11:21 ` Damien Le Moal
2019-07-18 14:11 ` Jeff Moyer
2019-07-18 23:02 ` Damien Le Moal
2019-07-19 14:25 ` Jeff Moyer
2019-07-20 1:07 ` Damien Le Moal
2019-07-22 0:12 ` Dave Chinner
2019-07-20 7:15 ` Damien Le Moal
2019-07-22 0:04 ` Dave Chinner
2019-07-22 0:09 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190712084718.GB16276@x250.microfocus.com \
--to=jthumshirn@suse.de \
--cc=Damien.LeMoal@wdc.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).