diff options
author | Changqing Li <changqing.li@windriver.com> | 2022-02-21 16:08:15 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-02 00:22:12 +0000 |
commit | 1e1c0d60acd198c5458d7d913b27a90f423c79e7 (patch) | |
tree | 8b26b4cb3fab0b96e3fdc2c8cf93b03420c7fb02 /meta | |
parent | b94f4ca8efd359cf00a3b9d8f3bc8e06e7081573 (diff) | |
download | poky-1e1c0d60acd198c5458d7d913b27a90f423c79e7.tar.gz |
e2fsprogs: backport to fix one regression
Backport a patch in 1.46.3 which fix one regression:
This is what the changelog says:
Fix e2fsck so that the if the s_interval is zero, and the last mount
or write time is in the future, it will fix invalid last mount/write
timestamps in the superblock. (This was a regression introduced in
v1.45.5.)
(From OE-Core rev: 9fe70a643a2d8723001421a18b5736e70a1eaa34)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs.inc | 3 | ||||
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch | 66 |
2 files changed, 68 insertions, 1 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc index fb02b2006e..1250a9b99c 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc | |||
@@ -19,7 +19,8 @@ LIC_FILES_CHKSUM = "file://NOTICE;md5=d50be0580c0b0a7fbc7a4830bbe6c12b \ | |||
19 | SECTION = "base" | 19 | SECTION = "base" |
20 | DEPENDS = "util-linux attr autoconf-archive" | 20 | DEPENDS = "util-linux attr autoconf-archive" |
21 | 21 | ||
22 | SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git;branch=master" | 22 | SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git;branch=master \ |
23 | file://0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch" | ||
23 | S = "${WORKDIR}/git" | 24 | S = "${WORKDIR}/git" |
24 | 25 | ||
25 | inherit autotools gettext texinfo pkgconfig multilib_header update-alternatives ptest | 26 | inherit autotools gettext texinfo pkgconfig multilib_header update-alternatives ptest |
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch new file mode 100644 index 0000000000..d679b25b1d --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From 2c69c94217b6db083d601d4fd62d6ab6c1628fee Mon Sep 17 00:00:00 2001 | ||
2 | From: Lukas Czerner <lczerner@redhat.com> | ||
3 | Date: Mon, 14 Jun 2021 15:27:25 +0200 | ||
4 | Subject: [PATCH] e2fsck: fix last mount/write time when e2fsck is forced | ||
5 | |||
6 | With commit c52d930f e2fsck is no longer able to fix bad last | ||
7 | mount/write time by default because it is conditioned on s_checkinterval | ||
8 | not being zero, which it is by default. | ||
9 | |||
10 | One place where it matters is when other e2fsprogs tools require to run | ||
11 | full file system check before a certain operation. If the last mount | ||
12 | time is for any reason in future, it will not allow it to run even if | ||
13 | full e2fsck is ran. | ||
14 | |||
15 | Fix it by checking the last mount/write time when the e2fsck is forced, | ||
16 | except for the case where we know the system clock is broken. | ||
17 | |||
18 | [ Reworked the conditionals so error messages claiming that the last | ||
19 | write/mount time were corrupted wouldn't be always printed when the | ||
20 | e2fsck was run with the -f option, thus causing 299 out of 372 | ||
21 | regression tests to fail. -- TYT ] | ||
22 | |||
23 | Fixes: c52d930f ("e2fsck: don't check for future superblock times if checkinterval == 0") | ||
24 | Reported-by: Dusty Mabe <dustymabe@redhat.com> | ||
25 | Signed-off-by: Lukas Czerner <lczerner@redhat.com> | ||
26 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | ||
27 | |||
28 | Upstream-Status: Backport [https://github.com/tytso/e2fsprogs/commit/2c69c94217b6db083d601d4fd62d6ab6c1628fee] | ||
29 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
30 | --- | ||
31 | e2fsck/super.c | 12 ++++++------ | ||
32 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
33 | |||
34 | diff --git a/e2fsck/super.c b/e2fsck/super.c | ||
35 | index e1c3f935..31e2ffb2 100644 | ||
36 | --- a/e2fsck/super.c | ||
37 | +++ b/e2fsck/super.c | ||
38 | @@ -1038,9 +1038,9 @@ void check_super_block(e2fsck_t ctx) | ||
39 | * Check to see if the superblock last mount time or last | ||
40 | * write time is in the future. | ||
41 | */ | ||
42 | - if (!broken_system_clock && fs->super->s_checkinterval && | ||
43 | - !(ctx->flags & E2F_FLAG_TIME_INSANE) && | ||
44 | - fs->super->s_mtime > (__u32) ctx->now) { | ||
45 | + if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) && | ||
46 | + !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) && | ||
47 | + (fs->super->s_mtime > (__u32) ctx->now)) { | ||
48 | pctx.num = fs->super->s_mtime; | ||
49 | problem = PR_0_FUTURE_SB_LAST_MOUNT; | ||
50 | if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge) | ||
51 | @@ -1050,9 +1050,9 @@ void check_super_block(e2fsck_t ctx) | ||
52 | fs->flags |= EXT2_FLAG_DIRTY; | ||
53 | } | ||
54 | } | ||
55 | - if (!broken_system_clock && fs->super->s_checkinterval && | ||
56 | - !(ctx->flags & E2F_FLAG_TIME_INSANE) && | ||
57 | - fs->super->s_wtime > (__u32) ctx->now) { | ||
58 | + if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) && | ||
59 | + !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) && | ||
60 | + (fs->super->s_wtime > (__u32) ctx->now)) { | ||
61 | pctx.num = fs->super->s_wtime; | ||
62 | problem = PR_0_FUTURE_SB_LAST_WRITE; | ||
63 | if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge) | ||
64 | -- | ||
65 | 2.25.1 | ||
66 | |||