Debian Woody with security updates Linux kernel 2.2.25 Samba 3.0.0 libc6 2.2.5 The problem I have is with a windows application that uses samba. This application is crucial for the organization, so if this is not fixed, and soon, we will have to ditch Samba and move to a windows server. I *really* don't want to do this, as Samba has been working so well for years now and billg is rich enough already. I am having problems with a windows client program that does a range lock on a file on a share. The log.smbd reports with debug level 3: [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1632) fcntl_lock: fcntl lock gave errno 75 (Value too large for defined data type) [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1651) fcntl_lock: lock failed at offset 4294967284 count 1 op 13 type 1 (Value too large for defined data type) [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(94) error string = Value too large for defined data type What I think is happening is the client is passing a number greater than 2^31 as the lock range, which will fail according to http://samba.org/samba/docs/man/locking.html#id2918968 which states that samba locks from 0-2^31, whereas windows issues lock requests up to 2^32 or 2^64. Setting "locking = no" fixes the problem, but will cause others as these files are used by many people at once. Do I have any options, or is this it for Samba on my site? I would really appreciate some help here. Thanks in anticipation, Jim Extended logfile output ---------------------------------------------------------------------- [2003/12/02 17:20:23, 3] smbd/sec_ctx.c:set_sec_ctx(288) setting sec ctx (1000, 1005) - sec_ctx_stack_ndx = 0 [2003/12/02 17:20:23, 3] lib/util.c:unix_clean_name(580) unix_clean_name [/caseflow/data/access.TXT] [2003/12/02 17:20:23, 3] smbd/dosmode.c:unix_mode(110) unix_mode(caseflow/data/access.txt) returning 0760 [2003/12/02 17:20:23, 3] lib/util.c:unix_clean_name(580) unix_clean_name [caseflow/data/access.txt] [2003/12/02 17:20:23, 2] smbd/open.c:open_file(250) jim opened file caseflow/data/access.txt read=Yes write=Yes (numopen=1) [2003/12/02 17:20:23, 3] smbd/process.c:process_smb(890) Transaction 4718 of length 76 [2003/12/02 17:20:23, 3] smbd/process.c:switch_message(685) switch message SMBtrans2 (pid 21538) [2003/12/02 17:20:23, 3] smbd/trans2.c:call_trans2qfilepathinfo(1841) call_trans2qfilepathinfo: TRANSACT2_QFILEINFO: level = 1006 [2003/12/02 17:20:23, 3] smbd/trans2.c:call_trans2qfilepathinfo(1929) call_trans2qfilepathinfo caseflow/data/access.txt (fnum = 7144) level=1006 call=7 total_data=0 [2003/12/02 17:20:23, 3] smbd/process.c:process_smb(890) Transaction 4719 of length 75 [2003/12/02 17:20:23, 3] smbd/process.c:switch_message(685) switch message SMBlockingX (pid 21538) [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1632) fcntl_lock: fcntl lock gave errno 75 (Value too large for defined data type) [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1651) fcntl_lock: lock failed at offset 4294967284 count 1 op 13 type 1 (Value too large for defined data type) [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(94) error string = Value too large for defined data type [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(113) error packet at smbd/reply.c(4208) cmd=36 (SMBlockingX) NT_STATUS_ACCESS_DENIED [2003/12/02 17:20:23, 3] smbd/process.c:process_smb(890) Transaction 4720 of length 75 [2003/12/02 17:20:23, 3] smbd/process.c:switch_message(685) switch message SMBlockingX (pid 21538) [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1632) fcntl_lock: fcntl lock gave errno 75 (Value too large for defined data type) [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1651) fcntl_lock: lock failed at offset 4294967280 count 1 op 13 type 1 (Value too large for defined data type) [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(94) error string = Value too large for defined data type [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(113) error packet at smbd/reply.c(4208) cmd=36 (SMBlockingX) NT_STATUS_ACCESS_DENIED [2003/12/02 17:20:23, 3] smbd/process.c:process_smb(890) Transaction 4721 of length 45 [2003/12/02 17:20:23, 3] smbd/process.c:switch_message(685) switch message SMBclose (pid 21538) --------------------------------------------------------------------------
Jeremy Allison
2003-Dec-03 00:54 UTC
[Samba] fcntl lock failed at large offset: pretty urgent
On Tue, Dec 02, 2003 at 07:47:50PM +1100, Jim Thomas wrote:> Debian Woody with security updates > Linux kernel 2.2.25 > Samba 3.0.0 > libc6 2.2.5 > > The problem I have is with a windows application that uses samba. This > application is crucial for the organization, so if this is not fixed, > and soon, we will have to ditch Samba and move to a windows server. > I *really* don't want to do this, as Samba has been working so well for > years now and billg is rich enough already. > > I am having problems with a windows client program that does a range > lock on a file on a share. The log.smbd reports with debug level 3: > > [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1632) > fcntl_lock: fcntl lock gave errno 75 (Value too large for defined data type) > [2003/12/02 17:20:23, 3] lib/util.c:fcntl_lock(1651) > fcntl_lock: lock failed at offset 4294967284 count 1 op 13 type 1 (Value too large for defined data type) > [2003/12/02 17:20:23, 3] smbd/error.c:error_packet(94) > error string = Value too large for defined data type > > What I think is happening is the client is passing a number > greater than 2^31 as the lock range, which will fail according to > http://samba.org/samba/docs/man/locking.html#id2918968 which states > that samba locks from 0-2^31, whereas windows issues lock requests up > to 2^32 or 2^64. > > Setting "locking = no" fixes the problem, but will cause others as these > files are used by many people at once.If Samba is configured to use 64 bit filesystems it assumes it can lock from 0 to 2^63-1 - the code in locking/posix.c in posix_fcntl_lock() takes care of this. If it is configured to use 32 bit filesystems it assumes it can lock from 0 to 2^31-1. Samba will truncate the posix lock above these limits as no posix application will ever see such a lock. You might get this problem if you're running a 64-bit Samba gatewaying onto a 32-bit mounted NFS mount, or other mounted partition. Can you give more details about the setup please ? This code has been stable and working for quite a long time now. Jeremy.