From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Howorth <dhoworth@mrc-lmb.cam.ac.uk>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_mkfs: wipe old signatures from the device
Date: Thu, 14 Feb 2013 13:17:12 -0600 [thread overview]
Message-ID: <511D3838.5000903@sandeen.net> (raw)
In-Reply-To: <511CCE67.5010402@mrc-lmb.cam.ac.uk>
On 2/14/13 5:45 AM, Dave Howorth wrote:
> Dave Chinner wrote:
>> IOWs, it is the responsibility of the filesystem tools to correctly
>> identify the filesystem being operated on, and not to
>> modify/trash/recover anything unless specifically directed by the
>> user. When a filesystem tool gets it wrong, then that specific tool
>> needs to be fixed. i.e. it is the responsibility of filesystem
>> tools to behave sanely, not for the rest of the world to have to
>> work around the dangerous behaviour of a specific filesystems'
>> toolset.
>
> As an average Joe user, I started to agree with this, but then as a
> developer I had second thoughts. It can't be right that every filesystem
> tool has to have code to recognize every other type of filesystem; that
> just doesn't scale. So each tool would need to call some API, which I
Yep - it's called libblkid, it's very easy to use for this purpose.
xfsprogs already does, and I just sent a patch for btrfs-progs as well.
So libblkid contains all the smarts, really, and it's not a code duplication
problem.
> suppose would need to access some kernel code that iterated for every
> filesystem type the kernel was configured to handle, or knew historically.
Nah, it doesn't matter what the running kernel knows about, IMHO, just what
is recognized on the disk at hand.
-Eric
> And then we have identical code in every tool, and that code is not
> serving the tool's primary purpose, so maybe it should be factored out
> on the one-tool-one-job philosophy. So perhaps there should be a single
> tool that tells what filesystem type is present on a device, which
> everybody runs before mkfs. Oh wait, df -T or other utilities already do
> that.
>
> So I'm not sure the issue is black and white. As an average Joe, I
> expect mkfs to trash whatever I give it, so I'm pretty careful to check
> what is there first. And if I expected to be overwriting an existing
> filesystem and I did it often enough to know about the mkfs.xfs
> behaviour, I suppose I would always invoke it with the -f flag.
> Consistency among the various flavours of mkfs would be nice, though.
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2013-02-14 19:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 11:06 [PATCH] xfs_mkfs: wipe old signatures from the device Lukas Czerner
2013-02-12 11:31 ` Karel Zak
2013-02-12 11:58 ` Lukáš Czerner
2013-02-12 20:27 ` Dave Chinner
2013-02-13 8:01 ` Karel Zak
2013-02-13 10:41 ` Lukáš Czerner
2013-02-13 12:16 ` Karel Zak
2013-02-13 22:17 ` Dave Chinner
2013-02-14 7:29 ` Chris Murphy
2013-02-14 8:36 ` Lukáš Czerner
2013-02-14 11:04 ` Dave Chinner
2013-02-14 12:28 ` Lukáš Czerner
2013-02-14 14:48 ` Martin Steigerwald
2013-02-14 18:35 ` Eric Sandeen
2013-02-14 14:54 ` Hugo Mills
2013-02-14 17:25 ` Eric Sandeen
2013-02-14 19:08 ` Chris Murphy
2013-02-14 11:45 ` Dave Howorth
2013-02-14 19:17 ` Eric Sandeen [this message]
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=511D3838.5000903@sandeen.net \
--to=sandeen@sandeen.net \
--cc=dhoworth@mrc-lmb.cam.ac.uk \
--cc=xfs@oss.sgi.com \
/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