* [PATCH] mm/shmem: tmpfs fallocate use file_modified()
@ 2022-08-11 4:55 Hugh Dickins
2022-08-12 8:20 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2022-08-11 4:55 UTC (permalink / raw)
To: Andrew Morton; +Cc: Darrick J. Wong, linux-kernel, linux-fsdevel, linux-mm
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.
Signed-off-by: Hugh Dickins <hughd@google.com>
---
mm/shmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2839,12 +2839,13 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size)
i_size_write(inode, offset + len);
- inode->i_ctime = current_time(inode);
undone:
spin_lock(&inode->i_lock);
inode->i_private = NULL;
spin_unlock(&inode->i_lock);
out:
+ if (!error)
+ file_modified(file);
inode_unlock(inode);
return error;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/shmem: tmpfs fallocate use file_modified()
2022-08-11 4:55 [PATCH] mm/shmem: tmpfs fallocate use file_modified() Hugh Dickins
@ 2022-08-12 8:20 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2022-08-12 8:20 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Darrick J. Wong, linux-kernel, linux-fsdevel, linux-mm
On Wed, Aug 10, 2022 at 09:55:36PM -0700, Hugh Dickins wrote:
> 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.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
Looks good to me,
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-12 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 4:55 [PATCH] mm/shmem: tmpfs fallocate use file_modified() Hugh Dickins
2022-08-12 8:20 ` Christian Brauner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.