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

Re: [Xen-devel] xen3.3.x on modern kernel / fs/aio.c / SUSE patches.xen/xen3-auto-common.diff



>>> On 17.05.12 at 23:05, Alex Bligh <alex@xxxxxxxxxxx> wrote:
> I am busy trying to forward-port xen3.3.x onto an Ubuntu Precise kernel.
> My route of attack is to apply all the patches.xen/ files that were
> in the SUSE 3.3.2 kernel release.
> 
> I appear to have been reasonably successful with this bar one change
> I don't understand.
> 
> In fs/aio.c, patches.xen/xen3-autocommon.diff has the following patch hunk
> listed at the end of this email. The first hunk applies fine. The later
> hunk does not. This is because the ioctx handling appears to have changed.
> I am not sure how this works or what it is trying to do.
> 
> The Ubuntu version had:
>         ioctx = ioctx_alloc(nr_events);
>         ret = PTR_ERR(ioctx);
>         if (!IS_ERR(ioctx)) {
>                 ret = put_user(ioctx->user_id, ctxp);
>                 if (!ret) {
>                         put_ioctx(ioctx);
>                         return 0;
>                 }
>                 io_destroy(ioctx);
>         }
> 
> out:
>         return ret;
> 
> Note the put_ioctx, ioctx_alloc, and lack of get_ioctx.
> 
> I /think/ the right solution here is as follows. Any ideas?
> 
>         ioctx = ioctx_alloc(nr_events);
>         ret = PTR_ERR(ioctx);
>         if (!IS_ERR(ioctx)) {
>                 ret = put_user(ioctx->user_id, ctxp);
> #ifdef CONFIG_EPOLL
>                 if (make_fd && ret >= 0)
>                         ret = make_aio_fd(ioctx);
> #endif
>                 if (!ret) {
>                         put_ioctx(ioctx);
>                         return 0;
>                 }
>                 io_destroy(ioctx);
>         }
> 
> out:
>         return ret;

Our code (3.4-rc6) looks like this

        if (!IS_ERR(ioctx)) {
                ret = put_user(ioctx->user_id, ctxp);
#ifdef CONFIG_EPOLL
                if (make_fd && !ret)
                        ret = make_aio_fd(ioctx);
#endif
                if (ret < 0)
                        io_destroy(ioctx);
                put_ioctx(ioctx);
        }

The patch apply failure and other confusion are presumably due
to a backport of a first attempt to address the issue someone
spotted in the AIO code - I would assume/hope that the full
3.4 solution got/will get backported to a later 3.3.x.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.