]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix possible deadlock when opening a seed device
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 7 Dec 2011 03:38:24 +0000 (11:38 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Wed, 11 Jan 2012 02:26:54 +0000 (10:26 +0800)
commit1d2c984d76285af32c8bd013322275aff3833996
tree5acc05bae14070f2dad3433a1482fe3a7bab0744
parente8aa5f1e270d120ec73fb2ef2e58c57073f3a1d7
Btrfs: fix possible deadlock when opening a seed device

The correct lock order is uuid_mutex -> volume_mutex -> chunk_mutex,
but when we mount a filesystem which has backing seed devices, we have
this lock chain:

    open_ctree()
        lock(chunk_mutex);
        read_chunk_tree();
            read_one_dev();
                open_seed_devices();
                    lock(uuid_mutex);

and then we hit a lockdep splat.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c