• Chandra Seetharaman's avatar
    dm: avoid destroying table in dm_any_congested · 8a57dfc6
    Chandra Seetharaman authored
    dm_any_congested() just checks for the DMF_BLOCK_IO and has no
    code to make sure that suspend waits for dm_any_congested() to
    complete.  This patch adds such a check.
    
    Without it, a race can occur with dm_table_put() attempting to
    destroying the table in the wrong thread, the one running
    dm_any_congested() which is meant to be quick and return
    immediately.
    
    Two examples of problems:
    1. Sleeping functions called from congested code, the caller
       of which holds a spin lock.
    2. An ABBA deadlock between pdflush and multipathd. The two locks
       in contention are inode lock and kernel lock.
    Signed-off-by: default avatarChandra Seetharaman <sekharan@us.ibm.com>
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    8a57dfc6
dm.c 34.1 KB