]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] dpt_i2o: Use GFP_ATOMIC when a lock is held
authorJulia Lawall <julia@diku.dk>
Sun, 30 May 2010 13:49:22 +0000 (15:49 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 27 Jul 2010 17:01:29 +0000 (12:01 -0500)
commit177b2371898ea3e65481fd0cda7636aeba5545ac
tree9c0a204817c3fd520b60adb085ede86b811392b3
parent740a58ce313b9c4d52a8976c4c68fa8f89c1a634
[SCSI] dpt_i2o: Use GFP_ATOMIC when a lock is held

The function adpt_i2o_post_wait is called from several places, in some of
which, such as adpt_abort, a lock may be held.

The functions adpt_i2o_reparse_lct and adpt_i2o_lct_get are called from
several places, including adpt_rescan where a lock may be held.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@gfp exists@
identifier fn;
position p;
@@

fn(...) {
 ... when != spin_unlock_irqrestore
     when any
 GFP_KERNEL@p
 ... when any
}

@locked@
identifier gfp.fn;
@@

spin_lock_irqsave(...)
...  when != spin_unlock_irqrestore
fn(...)

@depends on locked@
position gfp.p;
@@

- GFP_KERNEL@p
+ GFP_ATOMIC
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/dpt_i2o.c