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

* Re: [PATCH] netfs, cifs: Fix mtime/ctime update for mmapped writes
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2024-09-17  8:59 UTC (permalink / raw)
  To: David Howells
  Cc: Christian Brauner, kernel test robot, Jeff Layton,
	Paulo Alcantara, linux-cifs, netfs, linux-fsdevel, linux-kernel,
	Steve French

On Tue, 17 Sep 2024 08:54:28 +0100, David Howells wrote:
> 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.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] netfs, cifs: Fix mtime/ctime update for mmapped writes
      https://git.kernel.org/vfs/vfs/c/edd297c2764c

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

* Re: [PATCH] netfs, cifs: Fix mtime/ctime update for mmapped writes
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Paulo Alcantara @ 2024-09-17 17:55 UTC (permalink / raw)
  To: David Howells, Steve French, Christian Brauner
  Cc: dhowells, kernel test robot, Jeff Layton, linux-cifs, netfs,
	linux-fsdevel, linux-kernel

David Howells <dhowells@redhat.com> 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: 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(+)

Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>

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

* Re: [PATCH] netfs, cifs: Fix mtime/ctime update for mmapped writes
  2024-09-17 17:55 ` Paulo Alcantara
@ 2024-09-17 21:24   ` Steve French
  0 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2024-09-17 21:24 UTC (permalink / raw)
  To: Paulo Alcantara
  Cc: David Howells, Steve French, Christian Brauner, kernel test robot,
	Jeff Layton, linux-cifs, netfs, linux-fsdevel, linux-kernel

You can also add "Tested-by: Steve French <stfrench@microsoft.com>"

On Tue, Sep 17, 2024 at 1:01 PM Paulo Alcantara <pc@manguebit.com> wrote:
>
> David Howells <dhowells@redhat.com> 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: 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(+)
>
> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
>


-- 
Thanks,

Steve

^ permalink raw reply	[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