From owner-freebsd-current@FreeBSD.ORG Mon May 13 09:46:44 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EDBA2762 for ; Mon, 13 May 2013 09:46:44 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.33]) by mx1.freebsd.org (Postfix) with ESMTP id 5CAF1240 for ; Mon, 13 May 2013 09:46:43 +0000 (UTC) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by dlrexedge02.dlr.de (172.21.163.101) with Microsoft SMTP Server (TLS) id 14.2.328.9; Mon, 13 May 2013 11:46:15 +0200 Received: from KNOP-BEAGLE.kn.op.dlr.de (129.247.178.136) by smtp.dlr.de (172.21.152.151) with Microsoft SMTP Server (TLS) id 14.2.328.9; Mon, 13 May 2013 11:46:15 +0200 Date: Mon, 13 May 2013 11:46:10 +0200 From: Hartmut Brandt X-X-Sender: brandt_h@KNOP-BEAGLE.kn.op.dlr.de To: Rick Macklem Subject: Re: files disappearing from ls on NFS In-Reply-To: <1012361480.290121.1368323463788.JavaMail.root@erie.cs.uoguelph.ca> Message-ID: References: <1012361480.290121.1368323463788.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [129.247.178.136] Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 May 2013 09:46:45 -0000 On Sun, 12 May 2013, Rick Macklem wrote: RM>Hartmut Brandt wrote: RM>> Hi, RM>> RM>> I've updated one of my -current machines this week (previous update RM>> was in RM>> february). Now I see a strange effect (it seems only on NFS mounts): RM>> ls or RM>> even echo * will list only some files (strange enough the first files RM>> from RM>> the normal, alphabetically ordered list). If I change something in the RM>> directory (delete a file or create a new one) for some time the RM>> complete RM>> listing will appear but after sime time (seconds to a minute or so) RM>> again RM>> only part of the files is listed. RM>> RM>> A ktrace on ls /usr/src/lib/libc/gen shows that getdirentries is RM>> called RM>> only once (returning 4096). For a full listing getdirentries is called RM>> 5 RM>> times with the last returning 0. RM>> RM>> I can still open files that are not listed if I know their name, RM>> though. RM>> RM>> The NFS server is a Windows 2008 server with an OpenText NFS Server RM>> which RM>> works without problems to all the other FreeBSD machines. RM>> RM>> So what could that be? RM>> RM>I've attached a patch that might be worth trying. It is a "shot in the dark", RM>but brings the new NFS client's readdir closer to the old one (which you RM>mentioned still works ok). RM> RM>Please let me know how it goes, if you have a chance to test it, rick Hi Rick, the patch doesn't help. I wrote a small test program, which opens a directory, calls getdents(2) in a loop and dumps that. I figured out, that the return of the system call depends on the buffer size I pass to it. The directory has a block size of 4k according to fstat(2). If I use that, I get some 300 of the almost 500 directory entries. If I use 8k, I get just around 200 and if I use 16k I get a handfull. If I dump the buffer in this case I see 0x200 bytes filled with directory entries, then a lot of zeros and starting from 0x1000 again data. This is of course ignored because of the zeros before. All this looks very strange. harti