aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2024-07-19 16:01:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-24 15:54:06 +0200
commit5c0a6c40c2b9466685f3966eaeeecf036006bc57 (patch)
tree6ce68b9bcc509940329ecded55cb192fbe5c04e5
parent447c00d76e908ac215b8430ddc6aca6f494992cb (diff)
cifs: Fix missing fscache invalidation
commit a07d38afd15281c42613943a9a715c3ba07c21e6 upstream. A network filesystem needs to implement a netfslib hook to invalidate fscache if it's to be able to use the cache. Fix cifs to implement the cache invalidation hook. 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 Cc: stable@vger.kernel.org Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib") Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/smb/client/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index 6178c6d8097d..01e5a00ad7f6 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -123,6 +123,11 @@ fail:
goto out;
}
+static void cifs_netfs_invalidate_cache(struct netfs_io_request *wreq)
+{
+ cifs_invalidate_cache(wreq->inode, 0);
+}
+
/*
* Split the read up according to how many credits we can get for each piece.
* It's okay to sleep here if we need to wait for more credit to become
@@ -307,6 +312,7 @@ const struct netfs_request_ops cifs_req_ops = {
.begin_writeback = cifs_begin_writeback,
.prepare_write = cifs_prepare_write,
.issue_write = cifs_issue_write,
+ .invalidate_cache = cifs_netfs_invalidate_cache,
};
/*