From: David Anderson via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: linux-erofs@lists.ozlabs.org
Subject: [PATCH] erofs-utils: mkfs: Use extended inodes when ctime is set
Date: Tue, 1 Mar 2022 04:10:37 +0000 [thread overview]
Message-ID: <20220301041037.2271718-1-dvander@google.com> (raw)
Currently ctime is effectively ignored because most inodes are compact.
If ctime was set, and it's different from the build time, then extended
inodes should be used instead.
To guarantee that timestamps do not cause extended inodes, a fixed
timestamp should be used (-T).
Change-Id: I3d2e5c5ffe2bdcabea6791b5def5973b507aa316
Signed-off-by: David Anderson <dvander@google.com>
---
lib/inode.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/inode.c b/lib/inode.c
index f0a71a8..6f36c09 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -730,6 +730,10 @@ static bool erofs_should_use_inode_extended(struct erofs_inode *inode)
return true;
if (inode->i_nlink > USHRT_MAX)
return true;
+ if (inode->i_ctime != sbi.build_time ||
+ inode->i_ctime_nsec != sbi.build_time_nsec) {
+ return true;
+ }
return false;
}
--
2.35.1.574.g5d30c73bfb-goog
next reply other threads:[~2022-03-01 4:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 4:10 David Anderson via Linux-erofs [this message]
2022-03-01 5:17 ` [PATCH] erofs-utils: mkfs: Use extended inodes when ctime is set Gao Xiang
2022-03-01 6:06 ` David Anderson via Linux-erofs
2022-03-01 6:14 ` Gao Xiang
2022-03-11 3:53 ` David Anderson via Linux-erofs
2022-03-11 5:24 ` Gao Xiang
2022-03-18 4:55 ` David Anderson via Linux-erofs
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=20220301041037.2271718-1-dvander@google.com \
--to=linux-erofs@lists.ozlabs.org \
--cc=dvander@google.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