]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/stat.c
statx: don't clear STATX_ATIME on SB_RDONLY
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 14 May 2020 14:44:24 +0000 (16:44 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 14 May 2020 14:44:24 +0000 (16:44 +0200)
commit761e28fa270a3cc0f2ae9a0f4f778239b91a9df2
tree0b1315f97c6343a16270716a6c83e04886558ba6
parent581701b7efd60ba13d8a7eed60cbdd7fefaf6696
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 <mszeredi@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/stat.c