|
From: Thue J. K. <th...@gm...> - 2011-01-26 22:37:16
|
Hmm, right now I am unable to reproduce the problem, even without the patch. Regards, Thue 2011/1/25 Thue Janus Kristensen <th...@gm...> > Excellent! I will try it out when I get home :). > > Regards, Thue > > 2011/1/25 Miklos Szeredi <mi...@sz...> > > On Tue, 25 Jan 2011, Thue Janus Kristensen wrote: >> > I just tried starting both sshfs and a normal openssh sftp client at the >> > same time, both against the same server, as an experiment. >> > >> > When I rebooted the remote server, the ssh client said "Connection to >> > thuejk.dk closed by remote host.". The sshfs mount didn't say anything, >> and >> > will still hang any "ls" command which tries to read from the sshfs >> mount >> > point. >> > >> > At least in this case, it seems that sshfs should know that the other >> end is >> > going away permanently, but fails to act appropriately. >> >> Yeah, it should, but it doesn't. Following patch fixes it for me. >> >> Thanks, >> Miklos >> >> >> diff --git a/sshfs.c b/sshfs.c >> index 61f2b92..81ee64a 100644 >> --- a/sshfs.c >> +++ b/sshfs.c >> @@ -1314,17 +1314,16 @@ static void *process_requests(void *data_) >> break; >> } >> >> + pthread_mutex_lock(&sshfs.lock); >> + sshfs.processing_thread_started = 0; >> + close_conn(); >> + g_hash_table_foreach_remove(sshfs.reqtab, (GHRFunc) clean_req, >> NULL); >> + sshfs.connver ++; >> + pthread_mutex_unlock(&sshfs.lock); >> + >> if (!sshfs.reconnect) { >> /* harakiri */ >> kill(getpid(), SIGTERM); >> - } else { >> - pthread_mutex_lock(&sshfs.lock); >> - sshfs.processing_thread_started = 0; >> - close_conn(); >> - g_hash_table_foreach_remove(sshfs.reqtab, (GHRFunc) >> clean_req, >> - NULL); >> - sshfs.connver ++; >> - pthread_mutex_unlock(&sshfs.lock); >> } >> return NULL; >> } >> > > |