vfs_ceph: don't lie about flock support
authorDavid Disseldorp <ddiss@samba.org>
Thu, 5 Jul 2018 15:18:15 +0000 (17:18 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 13 Aug 2018 10:56:35 +0000 (12:56 +0200)
Instead, match vfs_gluster behaviour and require that users explicitly
disable "kernel share modes".

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13506

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 926ae50627d536735cee9b3931ee35bc19060261)

docs-xml/manpages/vfs_ceph.8.xml
source3/modules/vfs_ceph.c

index 453030e50de91217ef43de0b1510142be26f7737..813b430739efb6efbd33a9bd48d90416406dce1c 100644 (file)
        <programlisting>
                <smbconfsection name="[share]"/>
                <smbconfoption name="vfs objects">ceph</smbconfoption>
+               <smbconfoption name="path">/non-mounted/cephfs/path</smbconfoption>
+               <smbconfoption name="kernel share modes">no</smbconfoption>
        </programlisting>
+
+       <para>
+               Note that currently <command>kernel share modes</command> have
+               to be disabled in a share running with the CephFS vfs module for
+               file serving to work properly.
+       </para>
 </refsect1>
 
 <refsect1>
index 857310c2ac3b5541e877da7d6af8fa7e5480405b..b6707458b77c1fa24824ec5668724af8b751fa66 100644 (file)
@@ -1261,12 +1261,11 @@ static bool cephwrap_lock(struct vfs_handle_struct *handle, files_struct *fsp, i
 static int cephwrap_kernel_flock(struct vfs_handle_struct *handle, files_struct *fsp,
                                uint32_t share_mode, uint32_t access_mask)
 {
-       DBG_DEBUG("[CEPH] kernel_flock\n");
-       /*
-        * We must return zero here and pretend all is good.
-        * One day we might have this in CEPH.
-        */
-       return 0;
+       DBG_ERR("[CEPH] flock unsupported! Consider setting "
+               "\"kernel share modes = no\"\n");
+
+       errno = ENOSYS;
+       return -1;
 }
 
 static bool cephwrap_getlock(struct vfs_handle_struct *handle, files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)