dm: set DMF_SUSPENDED* _before_ clearing DMF_NOFLUSH_SUSPENDING
authorMike Snitzer <snitzer@redhat.com>
Tue, 2 Aug 2016 17:07:20 +0000 (13:07 -0400)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 20 Aug 2016 03:08:33 +0000 (23:08 -0400)
commit834ced1a13bdf510eae34d08bae1f1ae49b33141
tree64426e78973f8b2c8a445000ea5712e390143eb6
parent655fe78746d0b9141fe763535fc16d6652665c13
dm: set DMF_SUSPENDED* _before_ clearing DMF_NOFLUSH_SUSPENDING

[ Upstream commit eaf9a7361f47727b166688a9f2096854eef60fbe ]

Otherwise, there is potential for both DMF_SUSPENDED* and
DMF_NOFLUSH_SUSPENDING to not be set during dm_suspend() -- which is
definitely _not_ a valid state.

This fix, in conjuction with "dm rq: fix the starting and stopping of
blk-mq queues", addresses the potential for request-based DM multipath's
__multipath_map() to see !dm_noflush_suspending() during suspend.

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/md/dm.c