Re: [PATCH] cifs: don't call cifs_dfs_query_info_nonascii_quirk() if nodfs was set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enzo Matsumiya <ematsumiya@xxxxxxx> writes:

> Also return EOPNOTSUPP if path is remote but nodfs was set.
>
> Fixes: a2809d0e1696 ("cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs")
> Signed-off-by: Enzo Matsumiya <ematsumiya@xxxxxxx>
> ---
>  fs/cifs/connect.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 42e14f408856..1ef3d16a8bda 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -3432,6 +3432,7 @@ static int is_path_remote(struct mount_ctx *mnt_ctx)
>  	struct cifs_tcon *tcon = mnt_ctx->tcon;
>  	struct smb3_fs_context *ctx = mnt_ctx->fs_ctx;
>  	char *full_path;
> +	bool nodfs = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS;
>  
>  	if (!server->ops->is_path_accessible)
>  		return -EOPNOTSUPP;
> @@ -3449,14 +3450,20 @@ static int is_path_remote(struct mount_ctx *mnt_ctx)
>  	rc = server->ops->is_path_accessible(xid, tcon, cifs_sb,
>  					     full_path);
>  #ifdef CONFIG_CIFS_DFS_UPCALL
> -	if (rc == -ENOENT && is_tcon_dfs(tcon))
> +	if (nodfs) {
> +		if (rc == -EREMOTE)
> +			rc = -EOPNOTSUPP;
> +		goto out;
> +	}
> +
> +	/* path *might* exist with non-ASCII characters in DFS root
> +	 * try again with full path (only if nodfs is not set) */
> +	if (rc == -ENOENT && is_tcon_dfs(tcon) && !nodfs)

You can get rid of !nodfs check since it is useless.  The comment might
be kept, though.

Other than that,

Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx>

Steve, please mark it for stable.



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux