linux-stable/fs/ext2
Mikulas Patocka 12cd8fccc9 ext2: don't update mtime on COW faults
commit 1ef6ea0efe upstream.

When running in a dax mode, if the user maps a page with MAP_PRIVATE and
PROT_WRITE, the ext2 filesystem would incorrectly update ctime and mtime
when the user hits a COW fault.

This breaks building of the Linux kernel.  How to reproduce:

 1. extract the Linux kernel tree on dax-mounted ext2 filesystem
 2. run make clean
 3. run make -j12
 4. run make -j12

at step 4, make would incorrectly rebuild the whole kernel (although it
was already built in step 3).

The reason for the breakage is that almost all object files depend on
objtool.  When we run objtool, it takes COW page fault on its .data
section, and these faults will incorrectly update the timestamp of the
objtool binary.  The updated timestamp causes make to rebuild the whole
tree.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-09 19:12:30 +02:00
..
acl.c ext2: cache NULL when both default_acl and acl are NULL 2018-09-03 11:05:03 +02:00
acl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
balloc.c ext2: code cleanup for ext2_free_blocks() 2019-07-31 12:04:42 +02:00
dir.c ext2: use common file type conversion 2019-01-21 17:48:17 +01:00
ext2.h \n 2019-03-07 09:01:33 -08:00
file.c ext2: don't update mtime on COW faults 2020-09-09 19:12:30 +02:00
ialloc.c ext2: fix missing percpu_counter_inc 2020-08-21 13:05:26 +02:00
inode.c ext2: check err when partial != NULL 2019-12-17 19:56:43 +01:00
ioctl.c vfs: create a generic checking and prep function for FS_IOC_SETFLAGS 2019-07-01 08:25:34 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c ext2: support statx syscall 2019-02-18 15:14:43 +01:00
super.c ext2: Adjust indentation in ext2_fill_super 2020-02-11 04:35:45 -08:00
symlink.c ext2: support statx syscall 2019-02-18 15:14:43 +01:00
xattr.c ext2: fix debug reference to ext2_xattr_cache 2020-04-23 10:36:41 +02:00
xattr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xattr_security.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xattr_trusted.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xattr_user.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00