Skip to content

Commit 761e28f

Browse files
author
Miklos Szeredi
committed
statx: don't clear STATX_ATIME on SB_RDONLY
IS_NOATIME(inode) is defined as __IS_FLG(inode, SB_RDONLY|SB_NOATIME), so generic_fillattr() will clear STATX_ATIME from the result_mask if the super block is marked read only. This was probably not the intention, so fix to only clear STATX_ATIME if the fs doesn't support atime at all. Signed-off-by: Miklos Szeredi <[email protected]> Acked-by: David Howells <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 581701b commit 761e28f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/stat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
7373
query_flags &= KSTAT_QUERY_FLAGS;
7474

7575
/* allow the fs to override these if it really wants to */
76-
if (IS_NOATIME(inode))
76+
/* SB_NOATIME means filesystem supplies dummy atime value */
77+
if (inode->i_sb->s_flags & SB_NOATIME)
7778
stat->result_mask &= ~STATX_ATIME;
7879
if (IS_AUTOMOUNT(inode))
7980
stat->attributes |= STATX_ATTR_AUTOMOUNT;

0 commit comments

Comments
 (0)