]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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>
Sat, 28 Jul 2018 04:16:15 +0000 (06:16 +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 c492d31979df0470f03051d44a41e8839aa02eba..757b20ff4892b23a19540b5bb7a41b34663de919 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 9f752837a6a305669789c51aa9a0abe2a9e4b943..57bafec098cca5f78340fd91945de2965a2ac8d9 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)