From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar-Cavilla Subject: [PATCH] Only retry mapping pages when ENOENT is returned Date: Mon, 09 Jan 2012 16:40:34 -0500 Message-ID: <90f764bf02c3c7f78153.1326145234@xdev.gridcentric.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: ian.jackson@citrix.com, andres@gridcentric.ca, ian.campbell@citrix.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org tools/libxc/xc_linux_osdep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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. Signed-off-by: Adin Scannell Signed-off-by: Andres Lagar-Cavilla diff -r 2a2f3597d156 -r 90f764bf02c3 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 ); } }