Re: linux-cifs-client Digest, Vol 68, Issue 24 Patch:fix error handling in mount-time

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: linux-cifs-client Digest, Vol 68, Issue 24 Patch:fix error handling in mount-time

by Duffields :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I guess the Jeff Layton was suggesting that the code he included in his reply
would fix the problem I am having mounting a DNS-323 with Ubuntu 9.04
standard repository contents of samba.

But, not being a Linux developer, I have no idea of how to impliment the
patch.

Mac

On Fri July 24 2009 11:00:02 am linux-cifs-client-request@...
wrote:

> Send linux-cifs-client mailing list submissions to
> linux-cifs-client@...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.samba.org/mailman/listinfo/linux-cifs-client
> or, via email, send a message with subject or body 'help' to
> linux-cifs-client-request@...
>
> You can reach the person managing the list at
> linux-cifs-client-owner@...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of linux-cifs-client digest..."
>
>
> Today's Topics:
>
>    1. [PATCH] cifs: fix error handling in mount-time DFS referral
>       chasing code (Jeff Layton)
>    2. Cannot save files on NAS (Duffields)
>    3. Re: Cannot save files on NAS (Jeremy Allison)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 23 Jul 2009 15:22:30 -0400
> From: Jeff Layton <jlayton@...>
> To: smfrench@...
> Cc: sm@..., linux-cifs-client@...
> Subject: [linux-cifs-client] [PATCH] cifs: fix error handling in
> mount-time DFS referral chasing code
> Message-ID: <1248376950-12366-1-git-send-email-jlayton@...>
>
> If the referral is malformed or the hostname can't be resolved, then
> the current code generates an oops. Fix it to handle these errors
> gracefully.
>
> Reported-by: Sandro Mathys <sm@...>
> Signed-off-by: Jeff Layton <jlayton@...>
> ---
>  fs/cifs/cifs_dfs_ref.c |   12 +++++++++---
>  fs/cifs/connect.c      |   13 ++++++++++---
>  2 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
> index 3bb11be..606912d 100644
> --- a/fs/cifs/cifs_dfs_ref.c
> +++ b/fs/cifs/cifs_dfs_ref.c
> @@ -55,7 +55,7 @@ void cifs_dfs_release_automount_timer(void)
>   * i.e. strips from UNC trailing path that is not part of share
>   * name and fixup missing '\' in the begining of DFS node refferal
>   * if neccessary.
> - * Returns pointer to share name on success or NULL on error.
> + * Returns pointer to share name on success or ERR_PTR on error.
>   * Caller is responsible for freeing returned string.
>   */
>  static char *cifs_get_share_name(const char *node_name)
> @@ -68,7 +68,7 @@ static char *cifs_get_share_name(const char *node_name)
>   UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */,
>   GFP_KERNEL);
>   if (!UNC)
> - return NULL;
> + return ERR_PTR(-ENOMEM);
>
>   /* get share name and server name */
>   if (node_name[1] != '\\') {
> @@ -87,7 +87,7 @@ static char *cifs_get_share_name(const char *node_name)
>   cERROR(1, ("%s: no server name end in node name: %s",
>   __func__, node_name));
>   kfree(UNC);
> - return NULL;
> + return ERR_PTR(-EINVAL);
>   }
>
>   /* find sharename end */
> @@ -133,6 +133,12 @@ char *cifs_compose_mount_options(const char
> *sb_mountdata, return ERR_PTR(-EINVAL);
>
>   *devname = cifs_get_share_name(ref->node_name);
> + if (IS_ERR(*devname)) {
> + rc = PTR_ERR(*devname);
> + *devname = NULL;
> + goto compose_mount_options_err;
> + }
> +
>   rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
>   if (rc != 0) {
>   cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d",
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index fc44d31..f248688 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2544,11 +2544,20 @@ remote_path_check:
>
>   if (mount_data != mount_data_global)
>   kfree(mount_data);
> +
>   mount_data = cifs_compose_mount_options(
>   cifs_sb->mountdata, full_path + 1,
>   referrals, &fake_devname);
> - kfree(fake_devname);
> +
>   free_dfs_info_array(referrals, num_referrals);
> + kfree(fake_devname);
> + kfree(full_path);
> +
> + if (IS_ERR(mount_data)) {
> + rc = PTR_ERR(mount_data);
> + mount_data = NULL;
> + goto mount_fail_check;
> + }
>
>   if (tcon)
>   cifs_put_tcon(tcon);
> @@ -2556,8 +2565,6 @@ remote_path_check:
>   cifs_put_smb_ses(pSesInfo);
>
>   cleanup_volume_info(&volume_info);
> - FreeXid(xid);
> - kfree(full_path);
>   referral_walks_count++;
>   goto try_mount_again;
>   }


_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: linux-cifs-client Digest, Vol 68, Issue 24 Patch:fix error handling in mount-time

by Rob Shinn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Jul 26, 2009 at 07:51:36AM -0700, Duffields wrote:
> I guess the Jeff Layton was suggesting that the code he included in his reply
> would fix the problem I am having mounting a DNS-323 with Ubuntu 9.04
> standard repository contents of samba.
>
> But, not being a Linux developer, I have no idea of how to impliment the
> patch.
>

Hello.

'man patch' is your new best friend, but in general,
'patch -p1 <somefile.diff', or -p0,  whatever seems appropriate.



_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: linux-cifs-client Digest, Vol 68, Issue 24 Patch:fix error handling in mount-time

by Jeff Layton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 26 Jul 2009 07:51:36 -0700
Duffields <dhltd@...> wrote:

> I guess the Jeff Layton was suggesting that the code he included in his reply
> would fix the problem I am having mounting a DNS-323 with Ubuntu 9.04
> standard repository contents of samba.
>
> But, not being a Linux developer, I have no idea of how to impliment the
> patch.
>
> Mac
>

I don't recall suggesting that and didn't reply to your mail. Jeremy
also suggested that this was a samba bug. Perhaps you're thinking of
another problem?

--
Jeff Layton <jlayton@...>
_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client