• Alexander Viro's avatar
    [PATCH] Fix might_sleep in /proc/swaps code · c6845c0c
    Alexander Viro authored
    This fixes a locking problem noted by Tim Hockin:
        * /proc/swaps uses seq_file code, calling seq_path() with swaplock held
        * seq_path() calls d_path()
        * d_path() calls mntput() which might_sleep()
    
    We add a new semaphore protecting insertions/removals in the set of swap
    components + switch of ->start()/->stop() to the same semaphore [fixes
    deadlocks] + trivial cleanup of ->next().
    c6845c0c
swapfile.c 41.6 KB