[Samba] NFS re-export 64bit / 32bit locking issue?

Thomas Hannan thannan at pharm-olam.com
Fri Jan 23 21:14:18 GMT 2004


Hi Carsten and list,

I've dug into this a bit more, and found a few nuggets of information
under messages (in the samba archives) titled: "Re: fcntl lock failed at
large offset: pretty urgent" , as well as "Samba, Linux, and file
locking"

It seems that essentially what has happened, at least in my case, is
that Samba's configure script detects that my linux system *does* have
fcntl() and that the fcntl() is 64-bit aware. When a Windows/SMB client
requests a lock above 31 bits (which is what UNIX can normally handle
apparently) Samba handles the lock internally instead of handing the
request down to the POSIX fcntl() locking mechanism like it would if the
lock request was within the 31 bit range available on UNIX. Now since
Samba's configure script has incorrectly determined that it's on a
64-bit capable file system, it hands any received lock requests between
32-64 bits directly to fcntl(), which pukes when it tries to lock on a
31 bit NFS mount.

So, I'm assuming that somehow (since I haven't found any information
about NFS supporting 64 bit locks any time in the near future), I need
to force Samba to not believe that it's on a 64-bit capable system. The
only compile-time option that I see regarding locks is
"--with-spinlocks" instead of fcntl. I'm wondering if this would be any
better, or if we would end up with the same problem??

Possibly could the configure script be hacked to always fail the 64 bit
test??

Anyone?
Thomas


On Fri, 2004-01-23 at 02:27, Carsten Springenberg wrote:
> Hi Thomas,
> 
> I had (and still have) a similar problem. Browse the archive for the 
> thread I started on 11 November 2003 with subject "lock problem on 32 
> bit mounted nfs with 64 bit offsets"
> 
> The reactions where slim but not null and because of lack of time I used 
> the concerning NAS in another way (for backups)...but I would apreciate 
> to hear from your experience.
> 
> Bye,
> 
> Carsten
> 
> Thomas Hannan schrieb:
> > Hi all,
> > 
> > I've got kind of strange setup, wherein all of my data is on a big NFS
> > server (RH linux 8.0 running the 2.4.18 kernel and nfs-utils 1.0.1-2.80)
> > and my Samba 3.0.0 PDC server (RH linux 7.3 w/ 2.4.18 kernel, nfs-utils
> > 0.3.3-6.73) mounts the NFS export with the following options:
> > rw,vers=3,wsize=8192,rsize=8192,hard,intr
> > 
> > This mounted partition is then re-exported to the windows users with the
> > following smb.conf:
> > 
> > [global]
> > 	workgroup = POI
> > 	netbios name = POI-US
> > 	server string = "POI-USA file server"
> > 	passdb backend = ldapsam:ldap://192.168.1.215 ldap://192.168.1.60
> > 	guest account = smbguest
> > 	log level = 3
> > 	log file = /var/log/samba/%m.log
> > 	time server = Yes
> > 	socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384
> > SO_SNDBUF=16384
> > 	logon script = poi-basic.bat
> > 	logon path = \\%L\Profiles\%U
> > 	logon drive = H:
> > 	logon home = \\%L\%U\.profiles
> > 	domain logons = Yes
> > 	os level = 34
> > 	preferred master = Yes
> > 	domain master = Yes
> > 	wins support = Yes
> > 	ldap suffix = ou=accounts,ou=people,dc=pharm-olam,dc=com
> > 	ldap machine suffix =
> > ou=machines,ou=accounts,ou=people,dc=pharm-olam,dc=com
> > 	ldap user suffix = ou=users,ou=accounts,ou=people,dc=pharm-olam,dc=com
> > 	ldap group suffix =
> > ou=groups,ou=accounts,ou=people,dc=pharm-olam,dc=com
> > 	ldap idmap suffix = ou=accounts,ou=people,dc=pharm-olam,dc=com
> > 	ldap admin dn = cn=Manager,dc=pharm-olam,dc=com
> > 	ldap ssl = no
> > 
> > [homes]
> > 	read only = No
> > 	create mask = 0600
> > 	directory mask = 0700
> > 
> > [profiles]
> > 	path = /var/archive/samba/profiles
> > 	read only = No
> > 	create mask = 0600
> > 	directory mask = 0700
> > 	browseable = No
> > 
> > 
> > [POIAdmin]
> > 	comment = POI Administrative files
> > 	path = /var/archive/export/POI-Administrative
> > 	write list = poi-admin
> > 	read only = No
> > 	create mask = 0660
> > 	directory mask = 0770
> > 	oplocks = No
> > 	level2 oplocks = No
> > 
> > 
> > [netlogon]
> > 	path = /var/archive/samba/netlogon
> > 	locking = No
> > 
> > 
> > Everything works except that when users try to run QuickBooks or open up
> > some Excel documents, it is very very very slow opening them up, and
> > they occasionally get errors saying that a document could possibly be
> > corrupted or that they are low on memory, when only 10% of the windows
> > client's memory is used.
> > 
> > On the Samba server, I get a ton of error messages complaining about
> > trying to get a 64 bit lock when only 32 bit locks are available. I've
> > tried enabling and disabling oplocks to no avail. Is there a way to get
> > samba to not advertise that 64bit locks are available, or otherwise
> > resolve this?
> > 
> > Thanks much,
> > Thomas
> > 
> > (logs are below):
> > [2004/01/22 16:31:13, 3] lib/util.c:fcntl_lock(1632)
> >   fcntl_lock: fcntl lock gave errno 37 (No locks available)
> > [2004/01/22 16:31:13, 3] lib/util.c:fcntl_lock(1650)
> >   fcntl_lock: lock failed at offset 687 count 1 op 13 type 0 (No locks
> > available
> > )
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(656)
> >   posix_fcntl_lock: WARNING: lock request at offset 687, length 1
> > returned
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(658)
> >   an No locks available error. This can happen when using 64 bit lock
> > offsets
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(659)
> >   on 32 bit NFS mounted file systems.
> > [2004/01/22 16:31:13, 3] smbd/error.c:error_packet(94)
> >   error string = No locks available
> > [2004/01/22 16:31:13, 3] smbd/error.c:error_packet(109)
> >   error packet at smbd/reply.c(4208) cmd=36 (SMBlockingX)
> > NT_STATUS_ACCESS_DENIE
> > D
> > [2004/01/22 16:31:13, 3] smbd/process.c:process_smb(890)
> >   Transaction 41744 of length 63
> > [2004/01/22 16:31:13, 3] smbd/process.c:switch_message(685)
> >   switch message SMBreadX (pid 4473)
> > [2004/01/22 16:31:13, 3] smbd/reply.c:send_file_readX(1846)
> >   send_file_readX fnum=6397 max=1 nread=1
> > [2004/01/22 16:31:13, 3] smbd/process.c:process_smb(890)
> >   Transaction 41745 of length 75
> > [2004/01/22 16:31:13, 3] smbd/process.c:switch_message(685)
> >   switch message SMBlockingX (pid 4473)
> > [2004/01/22 16:31:13, 3] lib/util.c:fcntl_lock(1632)
> >   fcntl_lock: fcntl lock gave errno 37 (No locks available)
> > [2004/01/22 16:31:13, 3] lib/util.c:fcntl_lock(1650)
> >   fcntl_lock: lock failed at offset 688 count 1 op 13 type 0 (No locks
> > available
> > )
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(656)
> >   posix_fcntl_lock: WARNING: lock request at offset 688, length 1
> > returned
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(658)
> >   an No locks available error. This can happen when using 64 bit lock
> > offsets
> > [2004/01/22 16:31:13, 0] locking/posix.c:posix_fcntl_lock(659)
> >   on 32 bit NFS mounted file systems.
> > [2004/01/22 16:31:13, 3] smbd/error.c:error_packet(94)
> >   error string = No locks available
> > [2004/01/22 16:31:13, 3] smbd/error.c:error_packet(109)
> >   error packet at smbd/reply.c(4208) cmd=36 (SMBlockingX)
> > NT_STATUS_ACCESS_DENIE
> > D
> > 
> > 
> 
> 
> 




More information about the samba mailing list