Message ID | 20240719140907.1598372-1-dhowells@redhat.com (mailing list archive) |
---|---|
Headers | show |
Series | cifs: Miscellaneous fixes and a trace point | expand |
applied to cifs-2.6.git for-next and running regression tests on it now On Fri, Jul 19, 2024 at 9:09 AM David Howells <dhowells@redhat.com> wrote: > > Hi Steve, > > Here are four patches for cifs: > > (1) Fix re-repick of a server upon subrequest retry. > > (2) Fix some error code setting that got accidentally removed. > > (3) Fix the handling of the zero_point after a DIO write. It always needs > to be bumped past the end of the DIO write. > > (4) Add a tracepoint and some debugging to keep track of when we've ended > the ->in_flight contribution from an operation. > > I've pushed the patches here also: > > https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-fixes > > David > > David Howells (4): > cifs: Fix server re-repick on subrequest retry > cifs: Fix missing error code set > cifs: Fix setting of zero_point after DIO write > cifs: Add a tracepoint to track credits involved in R/W requests > > fs/smb/client/cifsglob.h | 17 +++++++----- > fs/smb/client/file.c | 47 +++++++++++++++++++++++++++++---- > fs/smb/client/smb1ops.c | 2 +- > fs/smb/client/smb2ops.c | 42 ++++++++++++++++++++++++++---- > fs/smb/client/smb2pdu.c | 43 +++++++++++++++++++++++++----- > fs/smb/client/trace.h | 55 ++++++++++++++++++++++++++++++++++++++- > fs/smb/client/transport.c | 8 +++--- > 7 files changed, 184 insertions(+), 30 deletions(-) > >
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>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <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
Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
---
fs/smb/client/file.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index f8d6ad88335e..b2405dd4d4d4 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -133,6 +133,11 @@ static void cifs_issue_write(struct netfs_io_subrequest *subreq)
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
@@ -337,6 +342,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,
};
/*