[Patch 02/12] CLD: fix hang in ncld_sess_close

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The use model of ncld made one thing obvious: the cldc_close has
two functions: it disposes of the handle in the client memory
(in theory -- in practice we do not free those until session
terminates), and also talks to the server about that. Our operations
have no own timers, so if session goes down, and someone tries to
close handles of it, the operation hangs forever. The ncld_close
could look at the status of cldc session, but it is a bit of a
layering violation. So, we make cldc_close to verify that the
session is not expired before proceeding.

It would probably be more consistent to make every cldc operation
do that, but the situation arises in practice only during closing
something without knowing if it's dead or alive.

Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx>

---
 lib/cldc.c |    4 ++++
 1 file changed, 4 insertions(+)

commit 9ecffa84d00f13c063a48f0c8784a0995cdd8007
Author: Master <zaitcev@xxxxxxxxxxxxxxxxxx>
Date:   Sat Apr 17 19:10:23 2010 -0600

    Fix hang in ncld_sess_close because of cldc_close.

diff --git a/lib/cldc.c b/lib/cldc.c
index 305e05d..c1e8993 100644
--- a/lib/cldc.c
+++ b/lib/cldc.c
@@ -1046,6 +1046,10 @@ int cldc_close(struct cldc_fh *fh, const struct cldc_call_opts *copts)
 		return -EINVAL;
 
 	sess = fh->sess;
+	if (sess->expired) {
+		fh->valid = false;
+		return -EPIPE;
+	}
 
 	/* create CLOSE message */
 	close_msg.fh = fh->fh;
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux