From: David Howells <dhowells@redhat.com>
To: Steve French <sfrench@samba.org>
Cc: dhowells@redhat.com, Paulo Alcantara <pc@manguebit.com>,
Shyam Prasad N <nspmangalore@gmail.com>,
Rohith Surabattula <rohiths.msft@gmail.com>,
Jeff Layton <jlayton@kernel.org>,
linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 5/4] cifs: Fix missing fscache invalidation
Date: Fri, 19 Jul 2024 16:25:23 +0100 [thread overview]
Message-ID: <1742063.1721402723@warthog.procyon.org.uk> (raw)
In-Reply-To: <20240719140907.1598372-1-dhowells@redhat.com>
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,
};
/*
prev parent reply other threads:[~2024-07-19 15:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 14:09 [PATCH 0/4] cifs: Miscellaneous fixes and a trace point David Howells
2024-07-19 14:09 ` [PATCH 1/4] cifs: Fix server re-repick on subrequest retry David Howells
2024-07-19 14:27 ` Tom Talpey
2024-07-19 15:45 ` Steve French
2024-07-19 14:09 ` [PATCH 2/4] cifs: Fix missing error code set David Howells
2024-07-19 14:09 ` [PATCH 3/4] cifs: Fix setting of zero_point after DIO write David Howells
2024-07-19 14:09 ` [PATCH 4/4] cifs: Add a tracepoint to track credits involved in R/W requests David Howells
2024-07-19 14:26 ` [PATCH 0/4] cifs: Miscellaneous fixes and a trace point Steve French
2024-07-19 15:25 ` David Howells [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1742063.1721402723@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nspmangalore@gmail.com \
--cc=pc@manguebit.com \
--cc=rohiths.msft@gmail.com \
--cc=sfrench@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox