[PATCH] vfs_ceph: don't lie about flock support

Jeremy Allison jra at samba.org
Fri Jul 6 18:35:58 UTC 2018


On Fri, Jul 06, 2018 at 05:04:13PM +0200, David Disseldorp via samba-technical wrote:
> The attached patchset addresses bug 13506: vfs_ceph lies about flock
> support.
> A follow-up manpage change is also included, describing vfs_ceph's
> CTDB_SAMBA_SKIP_SHARE_CHECK=yes requirement.

LGTM. RB+ and pushed.

Jeremy.

> From b6eb187212a1bb7ab02a29697b06c16957e4ed24 Mon Sep 17 00:00:00 2001
> From: David Disseldorp <ddiss at samba.org>
> Date: Thu, 5 Jul 2018 17:18:15 +0200
> Subject: [PATCH 1/2] 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 <ddiss at samba.org>
> ---
>  docs-xml/manpages/vfs_ceph.8.xml |  8 ++++++++
>  source3/modules/vfs_ceph.c       | 11 +++++------
>  2 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/docs-xml/manpages/vfs_ceph.8.xml b/docs-xml/manpages/vfs_ceph.8.xml
> index 453030e50de..813b430739e 100644
> --- a/docs-xml/manpages/vfs_ceph.8.xml
> +++ b/docs-xml/manpages/vfs_ceph.8.xml
> @@ -62,7 +62,15 @@
>  	<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>
> diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
> index b6ca27dd47e..47371bc9e08 100644
> --- a/source3/modules/vfs_ceph.c
> +++ b/source3/modules/vfs_ceph.c
> @@ -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)
> -- 
> 2.13.7
> 
> 
> From 3ccb59916a2fb13e301fd25392f909db6970ce6e Mon Sep 17 00:00:00 2001
> From: David Disseldorp <ddiss at samba.org>
> Date: Fri, 6 Jul 2018 13:31:43 +0200
> Subject: [PATCH 2/2] docs/vfs_ceph: add CTDB_SAMBA_SKIP_SHARE_CHECK=yes caveat
> 
> Mostly copied from the vfs_gluster manpage: the CephFS share path is not
> locally mounted, which breaks the ctdb_check_directories_probe() check.
> 
> Signed-off-by: David Disseldorp <ddiss at samba.org>
> ---
>  docs-xml/manpages/vfs_ceph.8.xml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/docs-xml/manpages/vfs_ceph.8.xml b/docs-xml/manpages/vfs_ceph.8.xml
> index 813b430739e..453052ebae9 100644
> --- a/docs-xml/manpages/vfs_ceph.8.xml
> +++ b/docs-xml/manpages/vfs_ceph.8.xml
> @@ -67,6 +67,17 @@
>  	</programlisting>
>  
>  	<para>
> +		Since <command>vfs_ceph</command> does not require a filesystem
> +		mount, the share <command>path</command> is treated differently:
> +		it is interpreted as an absolute path within the Ceph filesystem
> +		on the attached Ceph cluster.
> +		In a ctdb cluster environment where ctdb manages Samba,
> +		<command>CTDB_SAMBA_SKIP_SHARE_CHECK=yes</command> must be
> +		configured to disable local share path checks, otherwise ctdb
> +		will not reach a healthy state.
> +	</para>
> +
> +	<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.
> -- 
> 2.13.7
> 




More information about the samba-technical mailing list