From: Mikulas Patocka Date: Thu, 30 Oct 2008 13:33:12 +0000 (+0000) Subject: dm snapshot: fix register_snapshot deadlock X-Git-Tag: v2.6.28-rc3~40^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60c856c8e2f57a3f69c505735ef66e3719ea0bd6;p=pandora-kernel.git dm snapshot: fix register_snapshot deadlock register_snapshot() performs a GFP_KERNEL allocation while holding _origins_lock for write, but that could write out dirty pages onto a device that attempts to acquire _origins_lock for read, resulting in deadlock. So move the allocation up before taking the lock. This path is not performance-critical, so it doesn't matter that we allocate memory and free it if we find that we won't need it. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- Reading git-diff-tree failed