All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
Subject: Re: [PATCH 4/7] Mini-OS: add 9pfs frontend
Date: Mon, 6 Feb 2023 10:01:39 +0100	[thread overview]
Message-ID: <20230206090139.ehvf2czoocn6j7nc@begin> (raw)
In-Reply-To: <20230203091809.14478-5-jgross@suse.com>

Juergen Gross, le ven. 03 févr. 2023 10:18:06 +0100, a ecrit:
> +void *init_9pfront(unsigned int id, const char *mnt)
> +{
[...]
> +    free(xenbus_watch_path_token(XBT_NIL, bepath, bepath, &dev->events));

Better check for errors, otherwise the rest will hang without useful
feedback.

> +    for ( v = version; *v; v++ )
> +    {
> +        if ( strtoul(v, &v, 10) == 1 )
> +        {
> +            v = NULL;
> +            break;

This looks fragile? if version is "2.1" it will accept it apparently? I
guess better check whether strtoul did read a number, and in that case
break the loop anyway, successfully if the number is 1 and with failure
otherwise.

> +        }
> +    }
> +    free(version);
> +    if ( v )
> +    {
> +        reason = "version 1 not supported";
> +        goto err;
> +    }

This looks odd: when number 1 is detected this breaks out successfully,
while the error message otherwise says that it's version 1 which is not
supported? Is the message supposed to be "version greater than 1 not
supported"?

> + err:
> +    if ( bepath[0] )
> +        free(xenbus_unwatch_path_token(XBT_NIL, bepath, bepath));
> +    if ( msg )
> +        printk("9pfsfront add %u failed, error %s accessing Xenstore\n",
> +               id, msg);
> +    else
> +        printk("9pfsfront add %u failed, %s\n", id, reason);
> +    free_9pfront(dev);

In case of early errors, this will try to free uninitialized evtchn,
ring_ref, etc.

> +    free(msg);
> +    return NULL;
> +}

Samuel


  reply	other threads:[~2023-02-06  9:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03  9:18 [PATCH 0/7] Mini-OS: ad minimal 9pfs support Juergen Gross
2023-02-03  9:18 ` [PATCH 1/7] Mini-OS: xenbus: add support for reading node from directory Juergen Gross
2023-02-04 14:01   ` Samuel Thibault
2023-02-06  9:23     ` Juergen Gross
2023-02-03  9:18 ` [PATCH 2/7] Mini-OS: add concept of mount points Juergen Gross
2023-02-05 12:40   ` Samuel Thibault
2023-02-05 12:45   ` Samuel Thibault
2023-02-06  9:25     ` Juergen Gross
2023-02-03  9:18 ` [PATCH 3/7] Mini-OS: add support for runtime mounts Juergen Gross
2023-02-05 12:42   ` Samuel Thibault
2023-02-03  9:18 ` [PATCH 4/7] Mini-OS: add 9pfs frontend Juergen Gross
2023-02-06  9:01   ` Samuel Thibault [this message]
2023-02-06  9:22     ` Juergen Gross
2023-02-06  9:48       ` Samuel Thibault
2023-02-03  9:18 ` [PATCH 5/7] Mini-OS: add 9pfs transport layer Juergen Gross
2023-02-06  9:40   ` Samuel Thibault
2023-02-06 10:23     ` Juergen Gross
2023-02-03  9:18 ` [PATCH 6/7] Mini-OS: add open and close handling to the 9pfs frontend Juergen Gross
2023-02-03 12:50   ` Juergen Gross
2023-02-06 10:05   ` Samuel Thibault
2023-02-06 10:15     ` Juergen Gross
2023-02-03  9:18 ` [PATCH 7/7] Mini-OS: add read and write support to 9pfsfront Juergen Gross
2023-02-03 12:52   ` Juergen Gross
2023-02-06 10:13   ` Samuel Thibault
2023-02-06 10:17     ` Juergen Gross
2023-02-06 12:05       ` Samuel Thibault
2023-02-06 15:35         ` Juergen Gross
2023-02-06 10:14 ` [PATCH 0/7] Mini-OS: ad minimal 9pfs support Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230206090139.ehvf2czoocn6j7nc@begin \
    --to=samuel.thibault@ens-lyon.org \
    --cc=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.