From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Subject: [PATCH] erofs-utils: mkfs: introduce `--preserve-mtime'
Date: Sat, 11 Jun 2022 16:22:48 +0800 [thread overview]
Message-ID: <20220611082248.338369-1-xiang@kernel.org> (raw)
In the past versions, `-Eforce-inode-compact' worked since timestamps
were ignored. Currently, since we don't ignore mtime by default any
more, `-Eforce-inode-compact' fails and that breaks compatibility.
Let's fix `-Eforce-inode-compact' to ignore mtime as the past versions
did, also add another option `--preserve-mtime' for this.
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
man/mkfs.erofs.1 | 4 ++++
mkfs/main.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/man/mkfs.erofs.1 b/man/mkfs.erofs.1
index d61e33e..6017760 100644
--- a/man/mkfs.erofs.1
+++ b/man/mkfs.erofs.1
@@ -119,6 +119,10 @@ can reduce total metadata size.
.TP
.BI "\-\-max-extent-bytes " #
Specify maximum decompressed extent size # in bytes.
+.TP
+.B "\-\-preserve-mtime"
+File modification time is preserved whenever \fBmkfs.erofs\fR decides to use
+extended inodes over compact inodes.
.SH AUTHOR
This version of \fBmkfs.erofs\fR is written by Li Guifu <blucerlee@gmail.com>,
Miao Xie <miaoxie@huawei.com> and Gao Xiang <xiang@kernel.org> with
diff --git a/mkfs/main.c b/mkfs/main.c
index 9d43cd4..54a3fed 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -50,6 +50,7 @@ static struct option long_options[] = {
{"quiet", no_argument, 0, 12},
{"blobdev", required_argument, NULL, 13},
{"ignore-mtime", no_argument, NULL, 14},
+ {"preserve-mtime", no_argument, NULL, 15},
#ifdef WITH_ANDROID
{"mount-point", required_argument, NULL, 512},
{"product-out", required_argument, NULL, 513},
@@ -158,6 +159,7 @@ static int parse_extended_opts(const char *opts)
if (vallen)
return -EINVAL;
cfg.c_force_inodeversion = FORCE_INODE_COMPACT;
+ cfg.c_ignore_mtime = true;
}
if (MATCH_EXTENTED_OPT("force-inode-extended", token, keylen)) {
@@ -377,6 +379,9 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
case 14:
cfg.c_ignore_mtime = true;
break;
+ case 15:
+ cfg.c_ignore_mtime = false;
+ break;
case 1:
usage();
exit(0);
--
2.30.2
reply other threads:[~2022-06-11 8:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220611082248.338369-1-xiang@kernel.org \
--to=xiang@kernel.org \
--cc=linux-erofs@lists.ozlabs.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