Skip to content

Commit 665db14

Browse files
dhowellssmfrench
authored andcommitted
netfs, cifs: Fix mtime/ctime update for mmapped writes
The cifs flag CIFS_INO_MODIFIED_ATTR, which indicates that the mtime and ctime need to be written back on close, got taken over by netfs as NETFS_ICTX_MODIFIED_ATTR to avoid the need to call a function pointer to set it. The flag gets set correctly on buffered writes, but doesn't get set by netfs_page_mkwrite(), leading to occasional failures in generic/080 and generic/215. Fix this by setting the flag in netfs_page_mkwrite(). Fixes: 7342580 ("netfs, cifs: Move CIFS_INO_MODIFIED_ATTR to netfs_inode") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202409161629.98887b2-oliver.sang@intel.com Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 387676f commit 665db14

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/netfs/buffered_write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr
552552
trace_netfs_folio(folio, netfs_folio_trace_mkwrite);
553553
netfs_set_group(folio, netfs_group);
554554
file_update_time(file);
555+
set_bit(NETFS_ICTX_MODIFIED_ATTR, &ictx->flags);
555556
if (ictx->ops->post_modify)
556557
ictx->ops->post_modify(inode);
557558
ret = VM_FAULT_LOCKED;

0 commit comments

Comments
 (0)