Jukebox VFS module almost finished :-)

Greg Richards greg.richards at gec-group.com
Mon Mar 25 05:45:03 GMT 2002


The following is an earlier post on this list that
should fix the locking function because it uses
SMB_OFF_T as well.

Just 2 cents.  I also started doing an HSM for a Samba VFS,
I was using MySQL plus file pointers to offline files.

You might try the file pointers idea (kind of a soupped up symbolic
link file with all the file stats and the platter volume that contains
it)  I flagged them using the sticky bit, and modified the stat functions
to return stats from the contents of the file.  It seemed to be a more
efficient means of caching the information than using SQL.  It also is
less invasive (less functions to overide).

Greg Richards
greg.richards at gec-group.com



Am Dienstag, 5. März 2002 12:15 schrieb Timothee Besset:
> If you compile the example skel.so VFS module that comes with samba-2.2.3a
> tarball, SMB_OFF_T has sizeof 8 in the daemon, and 4 in the vfs module.
> This causes stack corruption in lseek function typically (and all others
> that use SMB_OFF_T prototypes).
>
> logged by smbd:
> sys_lseek fd 24 whence 136258136
> sizeof(SMB_OFF_T): 8
> seek_file: sys_lseek failed. Error was Invalid argument
> read_file: Failed to seek to 0
>
> logged by the skeleton module:
> Loading skeleton module!
> sizoef(SMB_OFF_T): 4
>
> This is on a Linux x86 Debian Woody
>
> note that this is samba-2.2.3a that I had to patch to fix the VFS code
> with Ries van twisk patches
>
> I also note that:
> sizeof(SMB_OFF_T) != SIZEOF_OFF_T
> the SIZEOF_OFF_T as defined in config.h is matching smbd, #define
> SIZEOF_OFF_T 8
>
> The only way I found around this is adding a #define SMB_OFF_T __off64_t
> in skel.c code before any #include <includes.h> and #include <vfs.h>
>
> TTimo

The same thing applies to Samba head. I added -D_LARGEFILE_SOURCE and
-D_FILE_OFFSET_BITS=64 to the makefile to make it work:

CFLAGS
= -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -Wall -g
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -fno-builtin

This is the way the Samba makefile does it.

...Juergen

-----Original Message-----
From: samba-technical-admin at lists.samba.org
[mailto:samba-technical-admin at lists.samba.org]On Behalf Of Andreas Lund
Sent: Saturday, March 23, 2002 5:26 PM
To: samba-technical at lists.samba.org
Subject: Re: Jukebox VFS module almost finished :-)


Sat, 23 Mar 2002 17:22:25 -0600, John Malmberg <wb8tyw at qsl.net> wrote:
> I would configure a directory on a real disk with the same files really
> on it, and compare the traces.
>
> Your goal is to get the VFS to produce the same results.
>
> It is pretty easy to single step through SMBD on OpenVMS, and I guess
> that the LINUX debuggers should be able to do the same.

Probably, but I have no idea how to do it so instead I rely on very verbose
logging. It's slower, but I finally nailed the problem. I had accidently
typed

!strncpy instead of !strncmp in an if() statement, which kinda screwed up
the
logic :o)

Only the locking problem remains now, AFAIK.

-Andreas.





More information about the samba-technical mailing list