lkml.org 
[lkml]   [2021]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 23/29] xen-scsiback: dont "handle" error by BUG()
    Date
    From: Jan Beulich <jbeulich@suse.com>

    commit 7c77474b2d22176d2bfb592ec74e0f2cb71352c9 upstream.

    In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
    Don't make problems worse, the more that handling elsewhere (together
    with map's status fields now indicating whether a mapping wasn't even
    attempted, and hence has to be considered failed) doesn't require this
    odd way of dealing with errors.

    This is part of XSA-362.

    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Cc: stable@vger.kernel.org
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/xen/xen-scsiback.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/xen/xen-scsiback.c
    +++ b/drivers/xen/xen-scsiback.c
    @@ -386,12 +386,12 @@ static int scsiback_gnttab_data_map_batc
    return 0;

    err = gnttab_map_refs(map, NULL, pg, cnt);
    - BUG_ON(err);
    for (i = 0; i < cnt; i++) {
    if (unlikely(map[i].status != GNTST_okay)) {
    pr_err("invalid buffer -- could not remap it\n");
    map[i].handle = SCSIBACK_INVALID_HANDLE;
    - err = -ENOMEM;
    + if (!err)
    + err = -ENOMEM;
    } else {
    get_page(pg[i]);
    }

    \
     
     \ /
      Last update: 2021-02-22 13:30    [W:4.644 / U:0.304 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site