The Samba-Bugzilla – Bug 5168
Excel cannot open CSV files.
Last modified: 2008-01-22 03:10:15 UTC
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 @@
+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
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])
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.
Created attachment 3082 [details]
VFS noflock patch
I made a patch to add VFS (noflock).
tar zxvf samba-3.0.28.tar.gz
patch < samba-3.0.28.vfs.patch
autoconf -I. -Ilib/replace
add "vfs objects = noflock" into smb.conf.
run nmbd and smbd.
patch -p0 < samba-3.0.28.vfs.patch
./configre -> ./configure
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.
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 126.96.36.199-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.