From: longli@linuxonhyperv.com
To: Steve French <sfrench@samba.org>,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-kernel@vger.kernel.org
Cc: Long Li <longli@microsoft.com>, stable@vger.kernel.org
Subject: [PATCH 2/7] cifs: smbd: Invalidate and deregister memory registration on re-send
Date: Wed, 16 Oct 2019 13:51:51 -0700 [thread overview]
Message-ID: <1571259116-102015-3-git-send-email-longli@linuxonhyperv.com> (raw)
In-Reply-To: <1571259116-102015-1-git-send-email-longli@linuxonhyperv.com>
From: Long Li <longli@microsoft.com>
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>
Cc: stable@vger.kernel.org
---
fs/cifs/file.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 4b95700c507c..3c4e01e56798 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2747,9 +2747,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 */
@@ -3472,7 +3480,14 @@ 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);
}
--
2.17.1
next prev parent reply other threads:[~2019-10-16 20:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 20:51 [PATCH 0/7] cifs: smbd: Improve reliability on transport reconnect longli
2019-10-16 20:51 ` [PATCH 1/7] cifs: Don't display RDMA transport on reconnect longli
2019-10-16 20:51 ` longli [this message]
2019-10-16 20:51 ` [PATCH 3/7] cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE longli
2019-10-16 20:51 ` [PATCH 4/7] cifs: smbd: Add messages on RDMA session destroy and reconnection longli
2019-10-16 20:51 ` [PATCH 5/7] cifs: smbd: Return -ECONNABORTED when trasnport is not in connected state longli
2019-10-16 20:51 ` [PATCH 6/7] cifs: smbd: Only queue work for error recovery on memory registration longli
2019-10-27 19:59 ` Steve French
2019-10-16 20:51 ` [PATCH 7/7] cifs: smbd: Return -EAGAIN when transport is reconnecting longli
2019-10-27 20:02 ` Steve French
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=1571259116-102015-3-git-send-email-longli@linuxonhyperv.com \
--to=longli@linuxonhyperv.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=stable@vger.kernel.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