[PATCH] vfs_gpfs: Asjust debug level when get_winattrs returns EBADF

Jeremy Allison jra at samba.org
Fri May 25 20:13:30 UTC 2018


On Thu, May 24, 2018 at 04:19:43PM -0700, Christof Schmitt via samba-technical wrote:
> On Thu, May 24, 2018 at 09:52:52AM +0200, Swen Schillig wrote:
> > Hi Christof
> > 
> > > I don't think you want to return with NT_STATUS_OK 
> > > in case of errno == EBADF.
> > > 
> > > Why not consolidating the errors a bit with a switch statement?
> > > So something like this 
> > Ok, my suggestion is wrong as well (ret could change during the error
> > processing for gpfswrap_get_winattrs_path) but I still think you need
> > to modify yours.
> 
> Yes, you are correct. The easiest way is probably adding the additional
> return to keep the same logic. See attached patch.

LGTM. RB+ and pushed.

> From 92fc86bc793c88965e65b445aea7c80f22655138 Mon Sep 17 00:00:00 2001
> From: Christof Schmitt <cs at samba.org>
> Date: Wed, 23 May 2018 15:04:08 -0700
> Subject: [PATCH] vfs_gpfs: Adjust debug level when get_winattrs returns EBADF
> 
> This is returned for a get_winattrs call against a non-gpfs file system.
> This can happen for the .. entry when listing a share on the file system
> root.
> 
> Signed-off-by: Christof Schmitt <cs at samba.org>
> ---
>  source3/modules/vfs_gpfs.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
> index a0fd48f..965dfac 100644
> --- a/source3/modules/vfs_gpfs.c
> +++ b/source3/modules/vfs_gpfs.c
> @@ -1612,7 +1612,16 @@ static NTSTATUS vfs_gpfs_get_dos_attributes(struct vfs_handle_struct *handle,
>  	if (ret == -1 && errno == EACCES) {
>  		ret = get_dos_attr_with_capability(smb_fname, &attrs);
>  	}
> -	if (ret == -1) {
> +
> +	if (ret == -1 && errno == EBADF) {
> +		/*
> +		 * Returned for directory listings in gpfs root for
> +		 * .. entry which steps out of gpfs.
> +		 */
> +		DBG_DEBUG("Getting winattrs for %s returned EBADF.\n",
> +			  smb_fname->base_name);
> +		return map_nt_error_from_unix(errno);
> +	} else if (ret == -1) {
>  		DBG_WARNING("Getting winattrs failed for %s: %s\n",
>  			    smb_fname->base_name, strerror(errno));
>  		return map_nt_error_from_unix(errno);
> -- 
> 1.8.3.1
> 




More information about the samba-technical mailing list