Patchwork cifs: return more accurate errno

login
register
mail settings
Submitter Dan Carpenter
Date May 7, 2010, 8:27 a.m.
Message ID <20100507082744.GR27064@bicker>
Download mbox | patch
Permalink /patch/53736/
State New
Headers show

Comments

Dan Carpenter - May 7, 2010, 8:27 a.m.
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@gmail.com>
---
Compile tested only.  Sorry.  :/
Jiri Kosina - May 18, 2010, 12:06 p.m.
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@gmail.com>
> ---
> Compile tested only.  Sorry.  :/
> 
> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
> index 78e4d2a..fa1f74a 100644
> --- a/fs/cifs/cifs_dfs_ref.c
> +++ b/fs/cifs/cifs_dfs_ref.c
> @@ -345,6 +345,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
>  	rc = get_dfs_path(xid, ses , full_path + 1, cifs_sb->local_nls,
>  		&num_referrals, &referrals,
>  		cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
> +	if (rc < 0)
> +		goto out_err;
>  
>  	for (i = 0; i < num_referrals; i++) {
>  		int len;

Has this ever been picked up? Doesn't seem to be present in linux-next.

Thanks,

Patch

diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 78e4d2a..fa1f74a 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -345,6 +345,8 @@  cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
 	rc = get_dfs_path(xid, ses , full_path + 1, cifs_sb->local_nls,
 		&num_referrals, &referrals,
 		cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
+	if (rc < 0)
+		goto out_err;
 
 	for (i = 0; i < num_referrals; i++) {
 		int len;