From dannyman@tellme.com  Fri Nov 10 18:18:53 2000
Return-Path: <dannyman@tellme.com>
Received: from never.tellme.com (never.tellme.com [209.157.156.27])
	by hub.freebsd.org (Postfix) with ESMTP id 4C7CB37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Nov 2000 18:18:53 -0800 (PST)
Received: by never.tellme.com (Postfix, from userid 501)
	id 8A15B71658; Fri, 10 Nov 2000 18:18:16 -0800 (PST)
Message-Id: <20001111021816.8A15B71658@never.tellme.com>
Date: Fri, 10 Nov 2000 18:18:16 -0800 (PST)
From: dannyman@tellme.com
Reply-To: dannyman@tellme.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: dannyman@tellme.com, doyle@tellme.com, firooz@tellme.com
Subject: ls locks up on directory listing
X-Send-Pr-Version: 3.2

>Number:         22761
>Category:       bin
>Synopsis:       ls locks up on directory listing
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 10 18:20:01 PST 2000
>Closed-Date:    Sat Nov 11 13:08:15 PST 2000
>Last-Modified:  Sat Nov 11 13:10:48 PST 2000
>Originator:     
>Release:        FreeBSD 3.5-RELEASE i386
>Organization:
Tellme Networks
>Environment:

From a NetApp:
foghorn.corp:/home on /home (nfs)

0-18:02 dannyman@never ~> nfsstat 
Client Info:
Rpc Counts:
  Getattr   Setattr    Lookup  Readlink      Read     Write    Create    Remove
 13041551    981861  18010114     18498  10223952   5019183    309187    323239
   Rename      Link   Symlink     Mkdir     Rmdir   Readdir  RdirPlus    Access
   120565     33858      2595      5077      2723   5170063         0  11546524
    Mknod    Fsstat    Fsinfo  PathConf    Commit    GLease    Vacate     Evict
        0   2702224        10         0    285030         0         0         0
Rpc Info:
 TimedOut   Invalid X Replies   Retries  Requests
        0         0     11287     52263  67796254
Cache Info:
Attr Hits    Misses Lkup Hits    Misses BioR Hits    Misses BioW Hits    Misses
245204053  13041551 132377762  18007772  60547599   9129326   2187979   5019183
BioRLHits    Misses BioD Hits    Misses DirE Hits    Misses
   537895     18498  14111657   3887028   2419685       849

Server Info:
  Getattr   Setattr    Lookup  Readlink      Read     Write    Create    Remove
        0         0         0         0         0         0         0         0
   Rename      Link   Symlink     Mkdir     Rmdir   Readdir  RdirPlus    Access
        0         0         0         0         0         0         0         0
    Mknod    Fsstat    Fsinfo  PathConf    Commit    GLease    Vacate     Evict
        0         0         0         0         0         0         0         0
Server Ret-Failed
                0
Server Faults
            0
Server Cache Stats:
   Inprog      Idem  Non-idem    Misses
        0         0         0         0
Server Lease Stats:
   Leases     PeakL   GLeases
        0         0         0
Server Write Gathering:
 WriteOps  WriteRPC   Opsaved
        0         0         0
0-18:02 dannyman@never ~> uname -r
3.5-RELEASE

>Description:

0-18:05 dannyman@never ~> truss ls ~firooz/work/feeds/incoming/sportsticker/11-10
syscall ioctl(1,TIOCGETA,0xbfbfd96c)
        returns 0 (0x0)
syscall ioctl(1,TIOCGWINSZ,0xbfbfd9bc)
        returns 0 (0x0)
syscall getuid()
        returns 501 (0x1f5)
syscall readlink("/etc/malloc.conf",0xbfbfd8f0,63)
        errno 2 'No such file or directory'
syscall mmap(0x0,4096,0x3,0x1002,-1,0x0)
        returns 671551488 (0x28071000)
syscall break(0x807d000)
        returns 0 (0x0)
syscall break(0x807e000)
        returns 0 (0x0)
syscall break(0x807f000)
        returns 0 (0x0)
syscall break(0x8080000)
        returns 0 (0x0)
syscall stat("/home/firooz/work/feeds/incoming/sportsticker/11-10",0xbfbfd8d8)
        returns 0 (0x0)
syscall open(".",0,00)
        returns 3 (0x3)
syscall fchdir(0x3)
        returns 0 (0x0)
syscall stat("/home/firooz/work/feeds/incoming/sportsticker/11-10",0xbfbfd8ac)
        returns 0 (0x0)

Command works on all other systems, including Solaris x86, Linux, and a
3.5-STABLE running a non-SMP kernel.  User reports that he can not get
directory listing via FTP, or od the directory.

Can not ^C or ^Z in tcsh or zsh, can not kill or kill -9 the process:

0-18:15 dannyman@never ~> ps -u dannyman | grep ls
dannyman 91056  0.0  0.0   356  196  r5- D     5:50PM   0:00.00 ls -F -l /home/
dannyman 95831  0.0  0.1   836  464  rg  I+    6:05PM   0:00.03 truss ls /home/
dannyman 95833  0.0  0.0   356  196  rg  D+    6:05PM   0:00.01 ls /home/firooz
0-18:15 dannyman@never ~> kill 91056 95831 95833
0-18:15 dannyman@never ~> kill -9 91056 95831 95833
0-18:16 dannyman@never ~> ps -u dannyman | grep ls
dannyman 91056  0.0  0.0   356  196  r5- D     5:50PM   0:00.00 ls -F -l /home/
dannyman 95833  0.0  0.0   356  196  rg  D     6:05PM   0:00.01 ls /home/firooz

Okay, so I was able to kill truss. :)

I am able to cat an arbitrary file within the directory.

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: Danny Howard <dannyman@tellme.com>
To: freebsd-gnats-submit@freebsd.org
Cc: Firooz Partovi <firooz@tellme.com>
Subject: Re: bin/22761: ls locks up on directory listing
Date: Fri, 10 Nov 2000 23:16:20 -0800

 Additional data from Firooz:
 
 O.K.  I moved all the files out of "11-10" and into another directory, "y".
 Then I renamed the empty "11-10" directory to "x", and renamed "y" to
 "11-10".  Now, you can do an ls of 11-10 that contains all the files of the
 original 11-10, but you can't do an ls of the empty directory "x".  It
 either has to do with the inode for x or with the contents of x as shown by
 the od command.  Unfortunately, I cannot do an od of x, because of NFS.
 Below is the result of stat on x.  The only notable thing (that can also be
 seen by an ls -l command) is the size of the directory, which has remained
 large after deleting all those files, but this has to do with the way
 directories are implemented.  Most implementations do not do garbage
 collection on directories every time you remove files from them.
 
 By the way, this all is under ~firooz/work/feeds/incoming/sportsticker.
 
 -Firooz
 File name = /home/firooz/work/feeds/incoming/sportsticker/x
 
 File type = directory
 
 File mode = 00040755
 
 Inode number = 5533051
 
 Device id = 33540
 
 Raw device id = 0
 
 Number of links = 2
 
 User ID = 570
 
 Group ID = 101
 
 File size in bytes = 663552
 
 Time of last access = Fri Nov 10 20:23:24 2000
 
 Time of last modification = Fri Nov 10 20:22:37 2000
 
 Time of last inode change = Fri Nov 10 20:38:29 2000
 
 Preferred I/O block size = 512
 
 Number of 512-byte blocks = 1304
 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Sat Nov 11 13:08:15 PST 2000 
State-Changed-Why:  

What you have here is not actually a problem report. This 
really should have been posted to 
freebsd-questions@freebsd.org, where you would have been 
told that the NFS code is greatly improved in version 4, 
and your best bet is to either upgrade to 4-Stable asap; 
or wait till 4.2-RELEASE comes out in a few days and 
upgrade then.  

Either way, please follow up to questions- if you need 
further assistance.  

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