From: David Disseldorp Date: Thu, 5 Jul 2018 15:18:15 +0000 (+0200) Subject: vfs_ceph: don't lie about flock support X-Git-Tag: samba-4.7.10~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be42bf487da2f2e94506840f18b47457fe31da75;p=thirdparty%2Fsamba.git vfs_ceph: don't lie about flock support 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 Reviewed-by: Jeremy Allison (cherry picked from commit 926ae50627d536735cee9b3931ee35bc19060261) --- diff --git a/docs-xml/manpages/vfs_ceph.8.xml b/docs-xml/manpages/vfs_ceph.8.xml index c492d31979d..757b20ff489 100644 --- a/docs-xml/manpages/vfs_ceph.8.xml +++ b/docs-xml/manpages/vfs_ceph.8.xml @@ -62,7 +62,15 @@ ceph + /non-mounted/cephfs/path + no + + + Note that currently kernel share modes have + to be disabled in a share running with the CephFS vfs module for + file serving to work properly. + diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 9f752837a6a..57bafec098c 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -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)