Re: ZFS vs Samba Debugging Results ... Need Help.

From: Timur I. Bakeyev <timur_at_com.bat.ru>
Date: Tue, 24 Jul 2007 02:44:04 +0200
Hi, Andrew!

On Sun, Jul 22, 2007 at 11:25:09AM +1000, tridge_at_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.
Received on Mon Jul 23 2007 - 22:44:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:15 UTC