View | Details | Raw Unified | Return to bug 153295
Collapse All | Expand All

(-)a/fs/cifs/cifsfs.c (-1 / +1 lines)
Lines 905-911 static int cifs_dnotify_thread(void * du Link Here
905
	struct cifsSesInfo *ses;
905
	struct cifsSesInfo *ses;
906
906
907
	do {
907
	do {
908
		if(try_to_freeze())
908
		if (try_to_freeze())
909
			continue;
909
			continue;
910
		set_current_state(TASK_INTERRUPTIBLE);
910
		set_current_state(TASK_INTERRUPTIBLE);
911
		schedule_timeout(15*HZ);
911
		schedule_timeout(15*HZ);
(-)a/fs/cifs/connect.c (-12 / +12 lines)
Lines 369-389 cifs_demultiplex_thread(struct TCP_Serve Link Here
369
			continue;
369
			continue;
370
		if (bigbuf == NULL) {
370
		if (bigbuf == NULL) {
371
			bigbuf = cifs_buf_get();
371
			bigbuf = cifs_buf_get();
372
			if(bigbuf == NULL) {
372
			if (!bigbuf) {
373
				cERROR(1,("No memory for large SMB response"));
373
				cERROR(1, ("No memory for large SMB response"));
374
				msleep(3000);
374
				msleep(3000);
375
				/* retry will check if exiting */
375
				/* retry will check if exiting */
376
				continue;
376
				continue;
377
			}
377
			}
378
		} else if(isLargeBuf) {
378
		} else if (isLargeBuf) {
379
			/* we are reusing a dirtry large buf, clear its start */
379
			/* we are reusing a dirty large buf, clear its start */
380
			memset(bigbuf, 0, sizeof (struct smb_hdr));
380
			memset(bigbuf, 0, sizeof (struct smb_hdr));
381
		}
381
		}
382
382
383
		if (smallbuf == NULL) {
383
		if (smallbuf == NULL) {
384
			smallbuf = cifs_small_buf_get();
384
			smallbuf = cifs_small_buf_get();
385
			if(smallbuf == NULL) {
385
			if (!smallbuf) {
386
				cERROR(1,("No memory for SMB response"));
386
				cERROR(1, ("No memory for SMB response"));
387
				msleep(1000);
387
				msleep(1000);
388
				/* retry will check if exiting */
388
				/* retry will check if exiting */
389
				continue;
389
				continue;
Lines 403-414 cifs_demultiplex_thread(struct TCP_Serve Link Here
403
		    kernel_recvmsg(csocket, &smb_msg,
403
		    kernel_recvmsg(csocket, &smb_msg,
404
				 &iov, 1, 4, 0 /* BB see socket.h flags */);
404
				 &iov, 1, 4, 0 /* BB see socket.h flags */);
405
405
406
		if(server->tcpStatus == CifsExiting) {
406
		if (server->tcpStatus == CifsExiting) {
407
			break;
407
			break;
408
		} else if (server->tcpStatus == CifsNeedReconnect) {
408
		} else if (server->tcpStatus == CifsNeedReconnect) {
409
			cFYI(1,("Reconnect after server stopped responding"));
409
			cFYI(1, ("Reconnect after server stopped responding"));
410
			cifs_reconnect(server);
410
			cifs_reconnect(server);
411
			cFYI(1,("call to reconnect done"));
411
			cFYI(1, ("call to reconnect done"));
412
			csocket = server->ssocket;
412
			csocket = server->ssocket;
413
			continue;
413
			continue;
414
		} else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) {
414
		} else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) {
Lines 417-431 cifs_demultiplex_thread(struct TCP_Serve Link Here
417
				tcpStatus CifsNeedReconnect if server hung */
417
				tcpStatus CifsNeedReconnect if server hung */
418
			continue;
418
			continue;
419
		} else if (length <= 0) {
419
		} else if (length <= 0) {
420
			if(server->tcpStatus == CifsNew) {
420
			if (server->tcpStatus == CifsNew) {
421
				cFYI(1,("tcp session abend after SMBnegprot"));
421
				cFYI(1, ("tcp session abend after SMBnegprot"));
422
				/* some servers kill the TCP session rather than
422
				/* some servers kill the TCP session rather than
423
				   returning an SMB negprot error, in which
423
				   returning an SMB negprot error, in which
424
				   case reconnecting here is not going to help,
424
				   case reconnecting here is not going to help,
425
				   and so simply return error to mount */
425
				   and so simply return error to mount */
426
				break;
426
				break;
427
			}
427
			}
428
			if(length == -EINTR) { 
428
			if (!try_to_freeze() && (length == -EINTR)) {
429
				cFYI(1,("cifsd thread killed"));
429
				cFYI(1,("cifsd thread killed"));
430
				break;
430
				break;
431
			}
431
			}

Return to bug 153295