From: Darrick J. Wong <djwong@xxxxxxxxxx> When iomap is enabled, the kernel is in charge of enforcing permissions checks on timestamp updates for files. We needn't do that in userspace anymore. Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx> --- misc/fuse2fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index f9151ae6acb4e5..5d75cffa8f6bca 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -4334,11 +4334,12 @@ static int op_utimens(const char *path, const struct timespec ctv[2] /* * ext4 allows timestamp updates of append-only files but only if we're - * setting to current time + * setting to current time. If iomap is enabled, the kernel does the + * permission checking for timestamp updates and we can skip the check. */ if (ctv[0].tv_nsec == UTIME_NOW && ctv[1].tv_nsec == UTIME_NOW) access |= A_OK; - ret = check_inum_access(ff, ino, access); + ret = fuse2fs_iomap_enabled(ff) ? 0 : check_inum_access(ff, ino, access); if (ret) goto out;