From nobody@FreeBSD.org  Mon Oct 14 09:46:49 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id C8FF2A64
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 Oct 2013 09:46:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 9CD3427E7
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 Oct 2013 09:46:49 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9E9km9T082009
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 Oct 2013 09:46:48 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9E9kmaV081991;
	Mon, 14 Oct 2013 09:46:48 GMT
	(envelope-from nobody)
Message-Id: <201310140946.r9E9kmaV081991@oldred.freebsd.org>
Date: Mon, 14 Oct 2013 09:46:48 GMT
From: Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [smbfs]Changeset r255138 broke smbfs in head and stable/10
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182963
>Category:       kern
>Synopsis:       [smbfs]Changeset r255138 broke smbfs in head and stable/10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 14 09:50:00 UTC 2013
>Closed-Date:    Thu Nov 14 09:41:13 UTC 2013
>Last-Modified:  Thu Nov 14 09:41:13 UTC 2013
>Originator:     Tomoaki AOKI
>Release:        head, stable/10
>Organization:
>Environment:
FreeBSD ***.***.*** 10.0-BETA1 FreeBSD 10.0-BETA1 #1 r256425M: Sun Oct 13 19:56:57 JST 2013     ***@***.***.***:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
After r255138, access to smb/cifs shares stops working correctly.

First I tried FreeBSD-10.0-ALPHA5-amd64-memstick.img to evaluate
for future transfer to stable/10 and noticed accessing to mounted
smbfs share is quite unstable.

If all directories in path contains a few entries, ls worked OK.
But if accessing any directories contains abouto 100 or more
entries, ls works abnormally.

For example, running even

  %ls /path/to/directory/containing/100_or_more/files

erroneously traverses to target's subdirectores, drops many entries randomly, and needs quite long times.

So I installed ALPHA5 to a VirtualBox VM, configured smbfs-related same as my stable/9 host for testing.

Latest modifications in sys/fs/smbfs and sys/netsmb is r254627 and r255219 each, so I tested r254627 and r255218, and resulted in OK for r254627 and NG for r255218.

After testing for some suspicious revisions, I finally determined the error is reproduced in r255138, while r255136 works OK.

If any questions, please contact me via The FreeBSD Forums, as my email address is filled with SPAMs and non white-listed mail should be missed, results in no response.
I have registerd The FreeBSD Forums as T-Aoki.
Replying to thread I created

  http://forums.freebsd.org/showthread.php?t=42502

is OK.

>How-To-Repeat:
Boot from affected revision and ls somewhere in smb/cifs share containing about 100 files/directories in it.

Even if directory contents are 10 or less, large file, such as .tgz, cannot read correctly (stops transferring in some points).
All ALPHA1 to 5 and BETA1 should be sufficient to repeat.
Even if ALPHA with debugging options, no errors are logged.

>Fix:
Case 1: Revert r255138 and buildkernel / installkernel.

Case 2: Alternatively to Case 1, apply changes in attached diff to sys/netsmb/smb_trantcp.c

Maybe, the cause is smb_trantcp.c does not chase struct sockbuf modification.


Patch attached with submission follows:

Index: /usr/src/sys/netsmb/smb_trantcp.c
===================================================================
--- /usr/src/sys/netsmb/smb_trantcp.c	(revision 256425)
+++ /usr/src/sys/netsmb/smb_trantcp.c	(working copy)
@@ -155,8 +155,8 @@
	SOCKBUF_LOCK(&so->so_rcv);
	soupcall_set(so, SO_RCV, nb_upcall, nbp);
	SOCKBUF_UNLOCK(&so->so_rcv);
-	so->so_rcv.sb_timeo = (5 * hz);
-	so->so_snd.sb_timeo = (5 * hz);
+	so->so_rcv.sb_timeo = (5 * SBT_1S);
+	so->so_snd.sb_timeo = (5 * SBT_1S);
	error = soreserve(so, nbp->nbp_sndbuf, nbp->nbp_rcvbuf);
	if (error)
		goto bad;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: glebius 
State-Changed-When: Fri Nov 8 08:44:31 UTC 2013 
State-Changed-Why:  
Committed. Thanks, Tomoaki! 


Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Fri Nov 8 08:44:31 UTC 2013 
Responsible-Changed-Why:  
Committed. Thanks, Tomoaki! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182963 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/182963: commit references a PR
Date: Fri,  8 Nov 2013 08:44:17 +0000 (UTC)

 Author: glebius
 Date: Fri Nov  8 08:44:09 2013
 New Revision: 257841
 URL: http://svnweb.freebsd.org/changeset/base/257841
 
 Log:
   Catch up with sb_timeo type change in r255138. This fixes
   smbfs operation.
   
   PR:		kern/182963
   Submitted by:	Tomoaki AOKI <junchoon dec.sakura.ne.jp>
 
 Modified:
   head/sys/netsmb/smb_trantcp.c
 
 Modified: head/sys/netsmb/smb_trantcp.c
 ==============================================================================
 --- head/sys/netsmb/smb_trantcp.c	Fri Nov  8 05:26:30 2013	(r257840)
 +++ head/sys/netsmb/smb_trantcp.c	Fri Nov  8 08:44:09 2013	(r257841)
 @@ -155,8 +155,8 @@ nb_connect_in(struct nbpcb *nbp, struct 
  	SOCKBUF_LOCK(&so->so_rcv);
  	soupcall_set(so, SO_RCV, nb_upcall, nbp);
  	SOCKBUF_UNLOCK(&so->so_rcv);
 -	so->so_rcv.sb_timeo = (5 * hz);
 -	so->so_snd.sb_timeo = (5 * hz);
 +	so->so_rcv.sb_timeo = (5 * SBT_1S);
 +	so->so_snd.sb_timeo = (5 * SBT_1S);
  	error = soreserve(so, nbp->nbp_sndbuf, nbp->nbp_rcvbuf);
  	if (error)
  		goto bad;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/182963: commit references a PR
Date: Thu, 14 Nov 2013 09:20:02 +0000 (UTC)

 Author: glebius
 Date: Thu Nov 14 09:19:50 2013
 New Revision: 258123
 URL: http://svnweb.freebsd.org/changeset/base/258123
 
 Log:
   Merge r257841 from head:
   
     Catch up with sb_timeo type change in r255138. This fixes
     smbfs operation.
   
   PR:		kern/182963
   Approved by:	re (kib)
 
 Modified:
   stable/10/sys/netsmb/smb_trantcp.c
 Directory Properties:
   stable/10/sys/   (props changed)
 
 Modified: stable/10/sys/netsmb/smb_trantcp.c
 ==============================================================================
 --- stable/10/sys/netsmb/smb_trantcp.c	Thu Nov 14 09:17:27 2013	(r258122)
 +++ stable/10/sys/netsmb/smb_trantcp.c	Thu Nov 14 09:19:50 2013	(r258123)
 @@ -155,8 +155,8 @@ nb_connect_in(struct nbpcb *nbp, struct 
  	SOCKBUF_LOCK(&so->so_rcv);
  	soupcall_set(so, SO_RCV, nb_upcall, nbp);
  	SOCKBUF_UNLOCK(&so->so_rcv);
 -	so->so_rcv.sb_timeo = (5 * hz);
 -	so->so_snd.sb_timeo = (5 * hz);
 +	so->so_rcv.sb_timeo = (5 * SBT_1S);
 +	so->so_snd.sb_timeo = (5 * SBT_1S);
  	error = soreserve(so, nbp->nbp_sndbuf, nbp->nbp_rcvbuf);
  	if (error)
  		goto bad;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: glebius 
State-Changed-When: Thu Nov 14 09:40:56 UTC 2013 
State-Changed-Why:  
Merged to stable/10. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182963 
>Unformatted:
