From owner-freebsd-current@FreeBSD.ORG Tue Jul 24 00:44:20 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1596516A418; Tue, 24 Jul 2007 00:44:20 +0000 (UTC) (envelope-from timur@com.bat.ru) Received: from mail.bat.ru (dzokonda.xs4all.nl [194.109.164.75]) by mx1.freebsd.org (Postfix) with ESMTP id 64C3213C457; Tue, 24 Jul 2007 00:44:19 +0000 (UTC) (envelope-from timur@com.bat.ru) Received: by mail.bat.ru (CommuniGate Pro PIPE 4.2.7) with PIPE id 497451; Tue, 24 Jul 2007 02:46:01 +0200 Received: from timur.home.bat.ru ([192.168.0.4] verified) by mail.bat.ru (CommuniGate Pro SMTP 4.2.7) with ESMTP-TLS id 497426; Tue, 24 Jul 2007 02:45:48 +0200 Received: (from timur@localhost) by timur.home.bat.ru (8.14.1/8.14.1/Submit) id l6O0i44X031417; Tue, 24 Jul 2007 02:44:04 +0200 (CEST) (envelope-from timur) Date: Tue, 24 Jul 2007 02:44:04 +0200 From: "Timur I. Bakeyev" To: tridge@samba.org Message-ID: <20070724004404.GE1874@com.bat.ru> References: <46633B27.50601@dva.dyndns.org> <1c5c32890707031732s195a97c3vd29fb46323f28fae@mail.gmail.com> <46644820.6020609@dva.dyndns.org> <1c5c32890707041057x75712a20vef9800a7ddef7a6a@mail.gmail.com> <1183674495.75595.14.camel@worf> <1c5c32890707051739t6621e2d4ude73ce5d096ea72e@mail.gmail.com> <1183698637.55166.58.camel@shumai.marcuscom.com> <20070721215822.GA1874@com.bat.ru> <18082.45557.77020.398761@samba.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18082.45557.77020.398761@samba.org> User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: current , "Timur I. Bakeyev" , Brian Donnell , "Boris S." , Pascal Hofstee Subject: Re: ZFS vs Samba Debugging Results ... Need Help. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 24 Jul 2007 00:44:20 -0000 Hi, Andrew! On Sun, Jul 22, 2007 at 11:25:09AM +1000, tridge@samba.org wrote: > Timur, > > > This is an old standing problem, came as a workaround for some > > assumptions about the opendir/telldir/seekdir behaviour in the POSIX > > systems, which made Andrew to write this workaround > > yes, this is a long standing problem. Basically we need > telldir()/seekdir() to actually work, and not consume unlimited > amounts of memory. Thanks a lot for your perfect explanation! I forgot a lot of details about this problem, as first time faced with it exactly two years ago: -rw-r--r-- 1 root wheel 564 Jul 25 2005 repdir.h Sorry, if it sounded like I was blaming you for the existing problem, I know that the ball is on our side :) > The original problems were: > > - when you use seekdir() after having deleted a file in the > directory, you end up in the wrong place in the directory > stream. > > - on some systems each telldir() allocates some memory, adding it to > a linked list. So if you do it a few million times then you lose a > lot of memory, and the closedir() takes an extraordinary amount of > time as it slowly frees the linked list I think this is a result of using DIRHASH optimisation, we should check, how the things work if it is disabled. > and here is some test code that demonstrates the problem: > > http://samba.org/ftp/unpacked/samba4/source/lib/replace/test/os2_delete.c I managed to find and old copy of the code you've sent me 2 years ago in my /tmp nothing is more persistent than temporary :) > There are many possible "quick fixes" in Samba. Unfortunately they > tend to have O(n^2) time or O(dirsize) memory usage, or both. That's > no good unfortunately. I think, I should create a PR about this problem and let kernel developers to find the possible solution. Still, taking into accound all the above it's strange, that Samba 3.0.24 was able to work with FS other than UFS flawlessly, but now Samba 3.0.25 croaks on just read attempt when accessing FAT FS or ISO9660. Something has changed in the code so a different route is taken. So, this have to be investigated farther. Thanks a lot for your help again! With best regards, Timur.