Re: [PATCH] cifs: handle cifs_get_tcon() errors properly

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

 



On Mon, 15 Nov 2010 18:15:23 +0530
Suresh Jayaraman <sjayaraman@xxxxxxx> wrote:

> cifs_get_tcon() could return any of the following errors:
> -ENOMEM/-ENODEV/EREMOTEIO. We should follow the DFS referral code path only
> when we get -EREMOTEIO (STATUS_PATH_NOT_COVERED) from the server and not
> otherwise.
> 
> Compile-tested only.
> 
> Signed-off-by: Suresh Jayaraman <sjayaraman@xxxxxxx>
> ---
>  fs/cifs/connect.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 251a17c..c3a2323 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2780,7 +2780,10 @@ try_mount_again:
>  	if (IS_ERR(tcon)) {
>  		rc = PTR_ERR(tcon);
>  		tcon = NULL;
> -		goto remote_path_check;
> +		if (rc == -EREMOTEIO)
> +			goto remote_path_check;
> +		else
> +			goto mount_fail_check;
>  	}
>  
>  	/* do not care if following two calls succeed - informational */

Don't you mean "EREMOTE" here? I've always interpreted "EREMOTEIO" to
mean that the server had the equivalent of an I/O error, whereas
"EREMOTE" means "Object is remote".

I don't see how this patch materially changes anything. Pseudocode,
assuming that rc == -EREMOTE:

remote_path_check:
        /* check if a whole path (including prepath) is not remote */
        if (!rc && cifs_sb->prepathlen && tcon) {
		/* stuff we won't hit because rc is non-zero */
	}

	if (rc == -EREMOTE) {
		/* handle a DFS referral */
	}

        if (rc)
                goto mount_fail_check;

I'll grant that cifs_mount is still a mess, but I'm not sure this
really improves anything.

-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux