Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715999 > unrolled thread

[Patch v2 18/19] CIFS: SMBD: Deregister memory when finishing SMB READ

Started byLong Li <longli@exchange.microsoft.com>
First post2017-08-20 21:10 +0200
Last post2017-08-20 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [Patch v2 18/19] CIFS: SMBD: Deregister memory when finishing SMB READ Long Li <longli@exchange.microsoft.com> - 2017-08-20 21:10 +0200

#1715999 — [Patch v2 18/19] CIFS: SMBD: Deregister memory when finishing SMB READ

FromLong Li <longli@exchange.microsoft.com>
Date2017-08-20 21:10 +0200
Subject[Patch v2 18/19] CIFS: SMBD: Deregister memory when finishing SMB READ
Message-ID<ugDLI-2xW-27@gated-at.bofh.it>
From: Long Li <longli@microsoft.com>

When SMB READ is finished, deregister the memory regions if RDMA write is used for this SMB READ. smbd_deregister_mr may need to do local invalidation and sleep, if server remote invalidation is not used.

Signed-off-by: Long Li <longli@microsoft.com>
---
 fs/cifs/smb2pdu.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 1f08c75..43a7b60 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2504,6 +2504,16 @@ smb2_readv_callback(struct mid_q_entry *mid)
 			rdata->result = -EIO;
 	}
 
+	/*
+	 * If this rdata has a memmory registered, the MR can be freed
+	 * MR needs to be freed as soon as I/O finishes to prevent deadlock
+	 * because they have limited number and are used for future I/Os
+	 */
+	if (rdata->mr) {
+		smbd_deregister_mr(rdata->mr);
+		rdata->mr = NULL;
+	}
+
 	if (rdata->result)
 		cifs_stats_fail_inc(tcon, SMB2_READ_HE);
 
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web