xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Adin Scannell <adin@scannell.ca>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Only retry mapping pages when ENOENT is returned
Date: Fri, 16 Dec 2011 22:55:20 -0500	[thread overview]
Message-ID: <14d42c7d8e0817040186.1324094120@dev.gridcentric.ca> (raw)

# HG changeset patch
# User Adin Scannell <adin@scannell.ca>
# Date 1324094033 18000
# Node ID 14d42c7d8e0817040186cd01c46f034999fc5dff
# Parent  9dcc8557a0cb676b84e6788e03ab596bcfda7143
Only retry mapping pages when ENOENT is returned

If the return value from the ioctl() is not ENOENT, it's possible that err[i]
will not be updated and libxc will just loop forever.  Although it's unlikely
that err[i] would not be updated after the ioctl() gets through at least once,
it's better to be defensive.

diff -r 9dcc8557a0cb -r 14d42c7d8e08 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -232,7 +232,7 @@ static void *linux_privcmd_map_foreign_b
             do {
                 usleep(100);
                 rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-            } while ( rc < 0 && err[i] == -ENOENT );
+            } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
         }
     }

             reply	other threads:[~2011-12-17  3:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17  3:55 Adin Scannell [this message]
2012-01-03 17:01 ` [PATCH] Only retry mapping pages when ENOENT is returned Ian Jackson
2012-01-03 17:15   ` Adin Scannell
2012-01-03 17:20     ` Ian Jackson
2012-01-04 10:46 ` Olaf Hering
2012-01-05 17:40   ` Ian Jackson
2012-01-06 14:44     ` Adin Scannell
  -- strict thread matches above, loose matches on Subject: below --
2012-01-09 21:40 Andres Lagar-Cavilla
2012-01-10 15:35 ` Ian Jackson

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=14d42c7d8e0817040186.1324094120@dev.gridcentric.ca \
    --to=adin@scannell.ca \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).