vfs_ceph: don't lie about flock support
authorDavid Disseldorp <ddiss@samba.org>
Thu, 5 Jul 2018 15:18:15 +0000 (17:18 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 6 Jul 2018 18:37:20 +0000 (20:37 +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>
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 b6ca27dd47ef7435c54bf97035022e098da463f4..47371bc9e08201d12ccdb9f3ba28996a50d15431 100644 (file)
@@ -1164,12 +1164,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)