• Mike Snitzer's avatar
    dm thin: send event about thin-pool state change _after_ making it · cd5d8a92
    Mike Snitzer authored
    commit f6c36758
    Sending a DM event before a thin-pool state change is about to happen is
    a bug.  It wasn't realized until it became clear that userspace response
    to the event raced with the actual state change that the event was
    meant to notify about.
    Fix this by first updating internal thin-pool state to reflect what the
    DM event is being issued about.  This fixes a long-standing racey/buggy
    userspace device-mapper-test-suite 'resize_io' test that would get an
    event but not find the state it was looking for -- so it would just go
    on to hang because no other events caused the test to reevaluate the
    thin-pool's state.
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
dm-thin.c 111 KB