Skip to content

Commit a07d38a

Browse files
dhowellsSteve French
authored andcommitted
cifs: Fix missing fscache invalidation
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: 3ee1a1f ("cifs: Cut over to using netfslib") Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 519be98 commit a07d38a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/smb/client/file.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ static void cifs_issue_write(struct netfs_io_subrequest *subreq)
133133
goto out;
134134
}
135135

136+
static void cifs_netfs_invalidate_cache(struct netfs_io_request *wreq)
137+
{
138+
cifs_invalidate_cache(wreq->inode, 0);
139+
}
140+
136141
/*
137142
* Split the read up according to how many credits we can get for each piece.
138143
* It's okay to sleep here if we need to wait for more credit to become
@@ -337,6 +342,7 @@ const struct netfs_request_ops cifs_req_ops = {
337342
.begin_writeback = cifs_begin_writeback,
338343
.prepare_write = cifs_prepare_write,
339344
.issue_write = cifs_issue_write,
345+
.invalidate_cache = cifs_netfs_invalidate_cache,
340346
};
341347

342348
/*

0 commit comments

Comments
 (0)