]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: Fix RDS_MSG_MAPPED usage.
authorChris Mason <chris.mason@oracle.com>
Fri, 3 Feb 2012 16:08:50 +0000 (11:08 -0500)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 23:41:31 +0000 (16:41 -0700)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
net/rds/send.c

index 11a6728e3a067503347e731de17e8a0ebc83ef1b..9967e9f5a65a2b9f8f84bf3446c45ab152923d00 100644 (file)
@@ -289,26 +289,32 @@ restart:
                /* The transport either sends the whole rdma or none of it */
                if (rm->rdma.op_active && !conn->c_xmit_rdma_sent) {
                        rm->m_final_op = &rm->rdma;
+                       /* The transport owns the mapped memory for now.
+                        * You can't unmap it while it's on the send queue */
+                       set_bit(RDS_MSG_MAPPED, &rm->m_flags);
                        ret = conn->c_trans->xmit_rdma(conn, &rm->rdma);
-                       if (ret)
+                       if (ret) {
+                               clear_bit(RDS_MSG_MAPPED, &rm->m_flags);
+                               wake_up_interruptible(&rm->m_flush_wait);
                                break;
+                       }
                        conn->c_xmit_rdma_sent = 1;
 
-                       /* The transport owns the mapped memory for now.
-                        * You can't unmap it while it's on the send queue */
-                       set_bit(RDS_MSG_MAPPED, &rm->m_flags);
                }
 
                if (rm->atomic.op_active && !conn->c_xmit_atomic_sent) {
                        rm->m_final_op = &rm->atomic;
+                       /* The transport owns the mapped memory for now.
+                        * You can't unmap it while it's on the send queue */
+                       set_bit(RDS_MSG_MAPPED, &rm->m_flags);
                        ret = conn->c_trans->xmit_atomic(conn, &rm->atomic);
-                       if (ret)
+                       if (ret) {
+                               clear_bit(RDS_MSG_MAPPED, &rm->m_flags);
+                               wake_up_interruptible(&rm->m_flush_wait);
                                break;
+                       }
                        conn->c_xmit_atomic_sent = 1;
 
-                       /* The transport owns the mapped memory for now.
-                        * You can't unmap it while it's on the send queue */
-                       set_bit(RDS_MSG_MAPPED, &rm->m_flags);
                }
 
                /*