Revision a1bb7d61233ba5fb5cd865f907a9ddcc8f8c02bd authored by Alan Jenkins on 14 February 2009, 01:01:14 UTC, committed by Linus Torvalds on 21 February 2009, 22:17:17 UTC
http://bugzilla.kernel.org/show_bug.cgi?id=12239

The image writing code dropped a reference to the current swap device.
This doesn't show up if the hibernation succeeds - because it doesn't
affect the image which gets resumed.  But it means multiple _failed_
hibernations end up freeing the swap device while it is still use!

swsusp_write() finds the block device for the swap file using swap_type_of().
It then uses blkdev_get() / blkdev_put() to open and close the block device.

Unfortunately, blkdev_get() assumes ownership of the inode of the block_device
passed to it.  So blkdev_put() calls iput() on the inode.  This is by design
and other callers expect this behaviour.  The fix is for swap_type_of() to take
a reference on the inode using bdget().

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent eed3ee0
History
File Mode Size
ChangeLog -rw-r--r-- 14.0 KB
Kconfig -rw-r--r-- 948 bytes
Makefile -rw-r--r-- 164 bytes
TODO -rw-r--r-- 385 bytes
befs.h -rw-r--r-- 3.2 KB
befs_fs_types.h -rw-r--r-- 4.9 KB
btree.c -rw-r--r-- 21.9 KB
btree.h -rw-r--r-- 300 bytes
datastream.c -rw-r--r-- 15.6 KB
datastream.h -rw-r--r-- 514 bytes
debug.c -rw-r--r-- 7.5 KB
endian.h -rw-r--r-- 3.1 KB
inode.c -rw-r--r-- 1.1 KB
inode.h -rw-r--r-- 123 bytes
io.c -rw-r--r-- 1.8 KB
io.h -rw-r--r-- 190 bytes
linuxvfs.c -rw-r--r-- 23.9 KB
super.c -rw-r--r-- 3.0 KB
super.h -rw-r--r-- 134 bytes

back to top