Hi again,
i coded a little example, where the described problem ALWAYS shows up.
It seems that UnionFS doesn't support seeking with dir-pointers
(telldir/seekdir), accept for the DIRECTORY_START_POINTER!
Samba uses this to move one dir-entry back, if the internal memory is
fully filled, so this is a "MUST work"...
I don't have the time right now to look into the unionfs-code myself, so
please someone carry on here ..
THX for all the good work :)
****** SNIP ********
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <stdio.h>
int main()
{
DIR* dh;
long prev_dirpos;
struct dirent* dn;
// Open Directory
dh = opendir( "/dir/on/unionfs/with/some/files" );
// Try reading dir-entries
prev_dirpos = telldir( dh ); // gets DIRECTORY_START_POINTER
dn = readdir( dh ); // read first entry - works!
if (dn==0) printf("ERROR found (1)!\n"); // never shows up
seekdir( dh, prev_dirpos ); // seeks to DIRECTORY_START_POINTER
dn = readdir( dh ); // and readdir works again!
if (dn==0) printf("ERROR found (2)!\n"); // never shows up
prev_dirpos = telldir( dh ); // gets pointer to first
direntry after DIRECTORY_START_POINTER
dn = readdir( dh ); // read another direntry
if (dn==0) printf("ERROR found (3)!\n"); // never shows up
seekdir( dh, prev_dirpos ); // seek to last entry = ONE
entry back
dn = readdir( dh ); // ERROR: Fails to read direntry
on UNIONFS
if (dn==0) printf("ERROR found (4)!\n"); // ALWAYS prints error!
// Close Directory
closedir( dh );
return 0;
}
****** SNIP ********
Oliver Seuffert wrote:
Hi,
another Problem occured to me:
I have a Fileserver with UnionFS (several branches RW) and users
access the files via SAMBA Windows-Shares.
In several cases not all files in a directory are shown, but only if
there are a lot of files in that perticular directory.
If SAMBA directly reads that directory on the specific branch (without
unionfs layer), all files are shown nicely.
I tried to debug SAMBA and found, that samba reads the directory
listing and stops when it has to send the first part of the listing
because the prepared internal memory buffer is filled, at least i
think it is that way. SAMBA doesn't continue reading the directory
listing after that.
Anybody experienced somthing like this? Any clue how to solve the
Problem?
Thx :)
Oliver Seuffert
_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs
_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs