René Nieuwenhuizen
2002-Nov-22 10:10 UTC
[Samba] Lock request returned EINVAL (samba-2.2.x on HP/UX 11.00) on local FS
Hi, Some time ago I had problems with samba-2.2.x (even samba-2.2.7) compiled on HP/UX 11.00 when processing locks on files. Sometimes I got: posix_fcntl_lock: WARNING: lock request at offset ..... The list came up with the possibility that the 64bit locks on 32bit filesystems like NFS fail with EINVAL. But my files were all local (vxfs version 3)! After recent investigation (wrote a locktest to find the offset upperlimit for locking) i found the limit to be 2Gb (32bit thus) even using 64bit lock calls and structures (-D_LARGEFILE64_SOURCE). To get real 64bit locking you need another definition to: -D_FILE_OFFSET_BITS=64 Any remarks? If not I suggest some patches for the HP/UX 11.00 environment (configure and configure.in) -- Ren? Nieuwenhuizen Afdeling Informatietechnologie Centraal Planbureau Bezoekadres: Van Stolkweg 14, 2585 JR Den Haag Postadres: Postbus 80510, 2508 GM Den Haag T (070) 3383 342 F (070) 3383 350 I http://www.cpb.nl/nl/general/org/afdelingen/it/ -- ===============================================================================Aan dit bericht kunnen geen rechten worden ontleend. Het bericht is alleen bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en de inhoud van het bericht te vernietigen. This message shall not constitute any obligations. This message is intended solely for the addressee. If you have received this message in error, please inform us immediately and delete its contents. ===============================================================================-------------- next part -------------- *** configure.orig Tue Nov 19 19:44:19 2002 --- configure Fri Nov 22 10:31:44 2002 *************** *** 1474,1480 **** ;; *11*) ! CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" cat >> confdefs.h <<\EOF #define _HPUX_SOURCE 1 EOF --- 1474,1480 ---- ;; *11*) ! CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" cat >> confdefs.h <<\EOF #define _HPUX_SOURCE 1 EOF *************** *** 1485,1490 **** --- 1485,1494 ---- cat >> confdefs.h <<\EOF #define _LARGEFILE64_SOURCE 1 + EOF + + cat >> confdefs.h <<\EOF + #define _FILE_OFFSET_BITS 64 EOF cat >> confdefs.h <<\EOF -------------- next part -------------- *** configure.in.orig Tue Nov 19 19:44:19 2002 --- configure.in Fri Nov 22 10:52:17 2002 *************** *** 247,256 **** AC_DEFINE(_MAX_ALIGNMENT,4) ;; *11*) ! CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" AC_DEFINE(_HPUX_SOURCE) AC_DEFINE(_POSIX_SOURCE) AC_DEFINE(_LARGEFILE64_SOURCE) AC_DEFINE(_ALIGNMENT_REQUIRED,1) AC_DEFINE(_MAX_ALIGNMENT,4) AC_DEFINE(USE_BOTH_CRYPT_CALLS) --- 247,257 ---- AC_DEFINE(_MAX_ALIGNMENT,4) ;; *11*) ! CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" AC_DEFINE(_HPUX_SOURCE) AC_DEFINE(_POSIX_SOURCE) AC_DEFINE(_LARGEFILE64_SOURCE) + AC_DEFINE(_FILE_OFFSET_BITS,64) AC_DEFINE(_ALIGNMENT_REQUIRED,1) AC_DEFINE(_MAX_ALIGNMENT,4) AC_DEFINE(USE_BOTH_CRYPT_CALLS)