[linux-cifs-client] [patch] cifs: return more accurate errno

Suresh Jayaraman sjayaraman at suse.de
Tue May 18 23:53:13 MDT 2010

On 05/19/2010 11:02 AM, Steve French wrote:
> On Tue, May 18, 2010 at 12:18 PM, Steve French <smfrench at gmail.com> wrote:
>> I will check.
>> On Tue, May 18, 2010 at 7:06 AM, Jiri Kosina <jkosina at suse.cz> wrote:
>>> On Fri, 7 May 2010, Dan Carpenter wrote:
>>>> Smatch compains that we don't use the return value from get_dfs_path().
>>>> In the original code if get_dfs_path() fails we return ERR_PTR(-ENOENT),
>>>> but with this patch we can return errno from get_dfs_path() directly.
>>>> Signed-off-by: Dan Carpenter <error27 at gmail.com>
> ENOENT does seem like a safe return code if a DFS referral can not be
> followed, but if the intent was to remap all error cases here to ENOENT
> it would be easier to follow with something similar to your code e.g.
> +       if (rc < 0) {
> +               rc = -ENOENT;
> +               goto out_err;
> +      }
> Igor,
> Did you intend to always return ENOENT for DFS when failures looking up

I don't think that was the intent. When called from cifs_mount, we seem
to be passing down the error code without remapping.

The GET_DFS_REFERRAL call could return -EREMOTE for example and
get_dfs_path() could return other valid errors say -ENODEV etc. I think
the original error code should be propagated back and the patch looks
correct to me.

> DFS referrals (probably most likely to be either error coming back from
>  tree connect to IPC$ or error from the call to GetDFSRefer)?


Suresh Jayaraman

More information about the samba-technical mailing list