All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Only retry mapping pages when ENOENT is returned
@ 2011-12-17  3:55 Adin Scannell
  2012-01-03 17:01 ` Ian Jackson
  2012-01-04 10:46 ` Olaf Hering
  0 siblings, 2 replies; 9+ messages in thread
From: Adin Scannell @ 2011-12-17  3:55 UTC (permalink / raw)
  To: xen-devel

# 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 );
         }
     }

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] Only retry mapping pages when ENOENT is returned
@ 2012-01-09 21:40 Andres Lagar-Cavilla
  2012-01-10 15:35 ` Ian Jackson
  0 siblings, 1 reply; 9+ messages in thread
From: Andres Lagar-Cavilla @ 2012-01-09 21:40 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, andres, ian.campbell, adin

 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 <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

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 );
         }
     }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-10 15:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17  3:55 [PATCH] Only retry mapping pages when ENOENT is returned Adin Scannell
2012-01-03 17:01 ` 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
2012-01-09 21:40 Andres Lagar-Cavilla
2012-01-10 15:35 ` Ian Jackson

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.