Mikulas Patocka 60c856c8e2 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 <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2008-10-30 13:33:12 +00:00
..
2006-01-01 22:21:50 +01:00
2007-10-20 02:01:11 +01:00
2005-04-16 15:20:36 -07:00
2008-10-21 17:45:03 +01:00
2008-10-21 17:44:59 +01:00
2008-10-21 17:44:59 +01:00
2008-10-21 17:44:59 +01:00
2008-10-21 17:44:59 +01:00
2008-10-30 13:33:07 +00:00
2008-10-21 17:44:59 +01:00
2008-10-21 17:44:59 +01:00
2007-10-20 02:01:07 +01:00
2007-10-20 02:01:26 +01:00
2008-10-21 17:44:59 +01:00
2008-10-21 17:44:57 +01:00
2008-02-06 10:41:18 -08:00
2005-09-17 11:49:58 -07:00
2005-04-16 15:20:36 -07:00
2007-10-29 07:41:32 -07:00
2005-04-16 15:20:36 -07:00
2007-10-29 07:41:32 -07:00
2007-10-29 07:41:32 -07:00
2007-10-29 07:41:32 -07:00
2005-04-16 15:20:36 -07:00