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

Re: [Xen-devel] [PATCH] Only retry mapping pages when ENOENT is returned



> I confess I don't understand the intended error handling here.  AFAICT
> this ioctl leaves a separate errno value for each request, in the
> array.  Presumably, however, it can also fail entirely and not update
> the separate in-array errno values.
>
> So how does one tell which of these is the case ?

ENOENT is returned in the case where everything is successful, but at
least one of the entries is ENOENT as the page was not available
(paged-out).  In other words, when ENOENT is returned you can trust
the errno entries were filled in.  It's a somewhat special case.

As you've pointed out, one cannot trust the errno vals if some
arbitrary error (like EINVAL) is returned.  The current code assumes
that after the first ENOENT, subsequent calls will be the same and the
errno vals can be read and trusted.  My patch was intended to fix this
behavior and only read the errno values when ENOENT is returned and
they are meaningful.  If you get back an EINVAL with my patch, the
loop will break and function call will fail.  Without the patch, it'll
keep looping forever (it's unlikely that this would ever happen, but I
noticed that the logic was a bit broken...).

Cheers,
-Adin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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