From: Miklos Szeredi Date: Thu, 24 Feb 2011 14:49:53 +0000 (+0100) Subject: mm: fix refcounting in swapon X-Git-Tag: v2.6.38-rc7~41 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8074b26f67165bf045d92e778c9c10dc5e207fc6;p=pandora-kernel.git mm: fix refcounting in swapon Grab a reference to bdev before calling blkdev_get(), which expects the refcount to be already incremented and either returns success or decrements the refcount and returns an error. The bug was introduced by e525fd89 (block: make blkdev_get/put() handle exclusive access), which didn't take into account this behavior of blkdev_get(). Acked-by: Tejun Heo Signed-off-by: Miklos Szeredi Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed