On Fedora Core 6 Linux, kernel-flock function does not work correctly with NFS-mounted files. This causes problem that Excel is not able to open CSV files. Fcntl F_WRCLK return error 11. I made a patch to force-off KERNEL_SHARE_MODES not to use flock function as follows. Apply this patch and do "autoconf -I. -Ilib/replace". And do "./configure --enable-kernel-share-modes=no". --- samba-3.0.28.org/source/configure.in 2007-11-21 12:58:01.000000000 +0900 +++ samba-3.0.28/source/configure.in 2007-12-29 20:07:34.000000000 +0900 @@ -2613,6 +2613,12 @@ } ], samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)]) + +AC_ARG_ENABLE(kernel_share_modes, [ --enable-kernel-share-modes Turn on kernel_share_modes (default=yes)]) +if test x$enable_kernel_share_modes = xno; then + samba_cv_HAVE_KERNEL_SHARE_MODES=no +fi + if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes]) fi
the flock operation is passed through the VFS these days. I'd stronly recommend to write a VFS module that just returns 0 on flock. This way you can make it a per share option. Volker
Created attachment 3082 [details] VFS noflock patch OK!!! I made a patch to add VFS (noflock). Usage: tar zxvf samba-3.0.28.tar.gz patch < samba-3.0.28.vfs.patch cd samba-3.0.28/source autoconf -I. -Ilib/replace ./configre make install add "vfs objects = noflock" into smb.conf. run nmbd and smbd.
correction: patch -p0 < samba-3.0.28.vfs.patch
./configre -> ./configure
Thanks! I know it's trivial, but are you ok with putting that module under GPLv2+? Pulic domain IMO in particular means that we can do anything with it, but I would like to confirm it. Volker
The description of this bug does not say which Linux kernel versions are affected by this problem. I had the same issue (NFS share exported via Samba, users can open MS Office files only in read-only mode) with this system: Linux 2.6.16.54-0.2.3-default, SUSE Linux Enterprise Server (SLES) 10 SP1. I've applied this patch and the problem is solved. Will this patch be included in 3.0.29?
I'm still waiting for confirmation by the patch author that it is ok to GPLv3 the code. Volker
Reinin, can you answer Volker's request?
closing this as WONFTFIX now. An alternative is also to set "kernel share modes = no" and "posix locking = no".