]> git.baikalelectronics.ru Git - kernel.git/commit
dm thin: send event about thin-pool state change _after_ making it
authorMike Snitzer <snitzer@redhat.com>
Tue, 11 Dec 2018 18:31:40 +0000 (13:31 -0500)
committerMike Snitzer <snitzer@redhat.com>
Tue, 11 Dec 2018 20:19:26 +0000 (15:19 -0500)
commitf6b5a2e44b99173708cda9e489bad321cb419303
tree5f9f861489c47f376ae85b7b942f6a231aca0c02
parent566c89d76d87766ebf5564f88772cf40f771754b
dm thin: send event about thin-pool state change _after_ making it

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: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-thin.c