Skip to content

Commit 15f242b

Browse files
Hugh Dickinsakpm00
authored andcommitted
mm/shmem: tmpfs fallocate use file_modified()
5.18 fixed the btrfs and ext4 fallocates to use file_modified(), as xfs was already doing, to drop privileges: and fstests generic/{683,684,688} expect this. There's no need to argue over keep-size allocation (which could just update ctime): fix shmem_fallocate() to behave the same way. Link: https://lkml.kernel.org/r/39c5e62-4896-7795-c0a0-f79c50d4909@google.com Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org> Cc: "Darrick J. Wong" <djwong@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Radoslaw Burny <rburny@google.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent cb24133 commit 15f242b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/shmem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2839,12 +2839,13 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
28392839

28402840
if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size)
28412841
i_size_write(inode, offset + len);
2842-
inode->i_ctime = current_time(inode);
28432842
undone:
28442843
spin_lock(&inode->i_lock);
28452844
inode->i_private = NULL;
28462845
spin_unlock(&inode->i_lock);
28472846
out:
2847+
if (!error)
2848+
file_modified(file);
28482849
inode_unlock(inode);
28492850
return error;
28502851
}

0 commit comments

Comments
 (0)