]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: Get rid of lockdep whinge on sys_swapon
authorMinchan Kim <minchan@kernel.org>
Thu, 7 Feb 2013 01:26:52 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:42 +0000 (16:46 +1100)
[1] forgot to initialize spin_lock so lockdep is whingeing
about it. This patch fixes it.

[1] 0f181e0e4, swap: add per-partition lock for swapfile

Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Tested-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Cc: Shaohua Li <shli@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c

index 7df5270fe3c84caabb411b46d070139a028806fa..9b51266413cd92e24e07841fbc6228313a266b2c 100644 (file)
@@ -1856,6 +1856,7 @@ static struct swap_info_struct *alloc_swap_info(void)
        p->flags = SWP_USED;
        p->next = -1;
        spin_unlock(&swap_lock);
+       spin_lock_init(&p->lock);
 
        return p;
 }