Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] netfs, cifs: Fix mtime/ctime update for mmapped writes
@ 2024-09-17  7:54 David Howells
  2024-09-17  8:59 ` Christian Brauner
  2024-09-17 17:55 ` Paulo Alcantara
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2024-09-17  7:54 UTC (permalink / raw)
  To: Steve French, Christian Brauner
  Cc: dhowells, kernel test robot, Jeff Layton, Paulo Alcantara,
	linux-cifs, netfs, linux-fsdevel, linux-kernel

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: 73425800ac94 ("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>
cc: Jeff Layton <jlayton@kernel.org>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/netfs/buffered_write.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c
index d7eae597e54d..b3910dfcb56d 100644
--- a/fs/netfs/buffered_write.c
+++ b/fs/netfs/buffered_write.c
@@ -552,6 +552,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr
 		trace_netfs_folio(folio, netfs_folio_trace_mkwrite);
 	netfs_set_group(folio, netfs_group);
 	file_update_time(file);
+	set_bit(NETFS_ICTX_MODIFIED_ATTR, &ictx->flags);
 	if (ictx->ops->post_modify)
 		ictx->ops->post_modify(inode);
 	ret = VM_FAULT_LOCKED;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-17 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17  7:54 [PATCH] netfs, cifs: Fix mtime/ctime update for mmapped writes David Howells
2024-09-17  8:59 ` Christian Brauner
2024-09-17 17:55 ` Paulo Alcantara
2024-09-17 21:24   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox