[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

Cc: Shaohua Li <[email protected]>
Reported/Tested-by: Valdis Kletnieks <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
---
 mm/swapfile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index dfaff5f..ac190d6 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1857,6 +1857,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;
 }
-- 
1.8.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to