Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen reset xio_xv before calling xbdback_io_erro...



details:   https://anonhg.NetBSD.org/src/rev/6c00e245c8a4
branches:  trunk
changeset: 952949:6c00e245c8a4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Feb 21 20:02:25 2021 +0000

description:
reset xio_xv before calling xbdback_io_error() so it won't try to unmap
the non-initialized handles when xen_shm_map() fails

remove the ratechecked error printf for shm error - xbdback_io_error() prints
the error too

part of fixes for XSA-362

diffstat:

 sys/arch/xen/xen/xbdback_xenbus.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r 231260a741d0 -r 6c00e245c8a4 sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Sun Feb 21 17:16:00 2021 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Sun Feb 21 20:02:25 2021 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.96 2020/05/07 19:49:29 bouyer Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.97 2021/02/21 20:02:25 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.96 2020/05/07 19:49:29 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.97 2021/02/21 20:02:25 jdolecek Exp $");
 
 #include <sys/buf.h>
 #include <sys/condvar.h>
@@ -1570,13 +1570,11 @@
 #endif
                return xbd_io;
        default:
-               if (ratecheck(&xbdi->xbdi_lasterr_time, &xbdback_err_intvl)) {
-                       printf("xbdback_map_shm: xen_shm error %d ", error);
-               }
+               /* reset xio_xv so error handling won't try to unmap it */
+               SLIST_INSERT_HEAD(&xbdi->xbdi_va_free, xbd_io->xio_xv, xv_next);
+               xbd_io->xio_xv = NULL;
                /* this will also free xbd_io via xbdback_iodone() */
                xbdback_io_error(xbd_io, error);
-               SLIST_INSERT_HEAD(&xbdi->xbdi_va_free, xbd_io->xio_xv, xv_next);
-               xbd_io->xio_xv = NULL;
                /* do not retry */
                xbdi->xbdi_cont = xbdback_co_main_incr;
                return xbdi;



Home | Main Index | Thread Index | Old Index