Skip to content
  • Eric Blake's avatar
    73e064cc
    nbd: Fix regression with multiple meta contexts · 73e064cc
    Eric Blake authored
    
    
    Detected by a hang in the libnbd testsuite.  If a client requests
    multiple meta contexts (both base:allocation and qemu:dirty-bitmap:x)
    at the same time, our attempt to silence a false-positive warning
    about a potential uninitialized variable introduced botched logic: we
    were short-circuiting the second context, and never sending the
    NBD_REPLY_FLAG_DONE.  Combining two 'if' into one 'if/else' in
    bdf200a5 was wrong (I'm a bit embarrassed that such a change was my
    initial suggestion after the v1 patch, then I did not review the v2
    patch that actually got committed). Revert that, and instead silence
    the false positive warning by replacing 'return ret' with 'return 0'
    (the value it always has at that point in the code, even though it
    eluded the deduction abilities of the robot that reported the false
    positive).
    
    Fixes: bdf200a5
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20200206173832.130004-1-eblake@redhat.com>
    Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
    73e064cc
    nbd: Fix regression with multiple meta contexts
    Eric Blake authored
    
    
    Detected by a hang in the libnbd testsuite.  If a client requests
    multiple meta contexts (both base:allocation and qemu:dirty-bitmap:x)
    at the same time, our attempt to silence a false-positive warning
    about a potential uninitialized variable introduced botched logic: we
    were short-circuiting the second context, and never sending the
    NBD_REPLY_FLAG_DONE.  Combining two 'if' into one 'if/else' in
    bdf200a5 was wrong (I'm a bit embarrassed that such a change was my
    initial suggestion after the v1 patch, then I did not review the v2
    patch that actually got committed). Revert that, and instead silence
    the false positive warning by replacing 'return ret' with 'return 0'
    (the value it always has at that point in the code, even though it
    eluded the deduction abilities of the robot that reported the false
    positive).
    
    Fixes: bdf200a5
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20200206173832.130004-1-eblake@redhat.com>
    Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
Loading