From: Drew Davenport <ddavenport@google.com>
To: linux-ext4@vger.kernel.org
Subject: [PATCH] e2fsprogs: Make -U option consistent between tune2fs and mke2fs
Date: Thu, 13 Apr 2017 12:47:02 -0700 [thread overview]
Message-ID: <20170413194702.GA41849@google.com> (raw)
Allow "null", "clear", "random", or "time" for the -U option for
mke2fs, which are already allowed options for tune2fs.
Signed-off-by: Drew Davenport <ddavenport@google.com>
---
misc/mke2fs.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 49c6e94d..b8d078a0 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2914,7 +2914,14 @@ int main (int argc, char *argv[])
* Parse or generate a UUID for the filesystem
*/
if (fs_uuid) {
- if (uuid_parse(fs_uuid, fs->super->s_uuid) !=0) {
+ if ((strcasecmp(fs_uuid, "null") == 0) ||
+ (strcasecmp(fs_uuid, "clear") == 0)) {
+ uuid_clear(fs->super->s_uuid);
+ } else if (strcasecmp(fs_uuid, "time") == 0) {
+ uuid_generate_time(fs->super->s_uuid);
+ } else if (strcasecmp(fs_uuid, "random") == 0) {
+ uuid_generate(fs->super->s_uuid);
+ } else if (uuid_parse(fs_uuid, fs->super->s_uuid) != 0) {
com_err(device_name, 0, "could not parse UUID: %s\n",
fs_uuid);
exit(1);
--
2.12.2.762.g0e3151a226-goog
next reply other threads:[~2017-04-13 19:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-13 19:47 Drew Davenport [this message]
2017-04-13 22:24 ` [PATCH] e2fsprogs: Make -U option consistent between tune2fs and mke2fs Andreas Dilger
2017-04-13 23:56 ` [PATCH v2] " Drew Davenport
2017-05-29 23:10 ` Theodore Ts'o
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=20170413194702.GA41849@google.com \
--to=ddavenport@google.com \
--cc=linux-ext4@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).