aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2019-10-15 22:54:50 +0000
committerSteve French <stfrench@microsoft.com>2019-11-25 01:14:14 -0600
commitb7a55bbd6d5402bfbadcfb3904e3c75b38ab5ba4 (patch)
tree262d00ad8925eb1b14601c8b2c51b94d0c1e6d0c /fs/cifs/file.c
parentcifs: Don't display RDMA transport on reconnect (diff)
downloadlinux-dev-b7a55bbd6d5402bfbadcfb3904e3c75b38ab5ba4.tar.xz
linux-dev-b7a55bbd6d5402bfbadcfb3904e3c75b38ab5ba4.zip
cifs: smbd: Invalidate and deregister memory registration on re-send for direct I/O
On re-send, there might be a reconnect and all prevoius memory registrations need to be invalidated and deregistered. Signed-off-by: Long Li <longli@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r--fs/cifs/file.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index a80ec683ea32..67e7d0ffe385 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2803,9 +2803,17 @@ cifs_resend_wdata(struct cifs_writedata *wdata, struct list_head *wdata_list,
if (!rc) {
if (wdata->cfile->invalidHandle)
rc = -EAGAIN;
- else
+ else {
+#ifdef CONFIG_CIFS_SMB_DIRECT
+ if (wdata->mr) {
+ wdata->mr->need_invalidate = true;
+ smbd_deregister_mr(wdata->mr);
+ wdata->mr = NULL;
+ }
+#endif
rc = server->ops->async_writev(wdata,
cifs_uncached_writedata_release);
+ }
}
/* If the write was successfully sent, we are done */
@@ -3528,8 +3536,16 @@ static int cifs_resend_rdata(struct cifs_readdata *rdata,
if (!rc) {
if (rdata->cfile->invalidHandle)
rc = -EAGAIN;
- else
+ else {
+#ifdef CONFIG_CIFS_SMB_DIRECT
+ if (rdata->mr) {
+ rdata->mr->need_invalidate = true;
+ smbd_deregister_mr(rdata->mr);
+ rdata->mr = NULL;
+ }
+#endif
rc = server->ops->async_readv(rdata);
+ }
}
/* If the read was successfully sent, we are done */