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
9p
adfs
affs
afs
autofs
autofs4
befs
bfs
btrfs
cifs
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs
efs
exportfs
ext2
ext3
ext4
fat
freevxfs
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
ncpfs
nfs
nfs_common
nfsd
nls
notify
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
ramfs
reiserfs
romfs
smbfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig -rw-r--r-- 6.7 KB
Kconfig.binfmt -rw-r--r-- 6.4 KB
Makefile -rw-r--r-- 3.9 KB
aio.c -rw-r--r-- 46.1 KB
anon_inodes.c -rw-r--r-- 5.0 KB
attr.c -rw-r--r-- 4.8 KB
bad_inode.c -rw-r--r-- 7.9 KB
binfmt_aout.c -rw-r--r-- 12.8 KB
binfmt_elf.c -rw-r--r-- 54.3 KB
binfmt_elf_fdpic.c -rw-r--r-- 47.5 KB
binfmt_em86.c -rw-r--r-- 2.8 KB
binfmt_flat.c -rw-r--r-- 26.2 KB
binfmt_misc.c -rw-r--r-- 15.1 KB
binfmt_script.c -rw-r--r-- 2.8 KB
binfmt_som.c -rw-r--r-- 7.5 KB
bio-integrity.c -rw-r--r-- 20.0 KB
bio.c -rw-r--r-- 38.3 KB
block_dev.c -rw-r--r-- 33.0 KB
buffer.c -rw-r--r-- 89.5 KB
char_dev.c -rw-r--r-- 13.2 KB
compat.c -rw-r--r-- 53.4 KB
compat_binfmt_elf.c -rw-r--r-- 3.4 KB
compat_ioctl.c -rw-r--r-- 81.2 KB
dcache.c -rw-r--r-- 59.9 KB
dcookies.c -rw-r--r-- 6.8 KB
direct-io.c -rw-r--r-- 34.4 KB
dquot.c -rw-r--r-- 67.5 KB
drop_caches.c -rw-r--r-- 1.6 KB
eventfd.c -rw-r--r-- 5.3 KB
eventpoll.c -rw-r--r-- 37.1 KB
exec.c -rw-r--r-- 42.8 KB
fcntl.c -rw-r--r-- 13.7 KB
fifo.c -rw-r--r-- 3.2 KB
file.c -rw-r--r-- 12.1 KB
file_table.c -rw-r--r-- 10.2 KB
filesystems.c -rw-r--r-- 6.3 KB
fs-writeback.c -rw-r--r-- 22.9 KB
generic_acl.c -rw-r--r-- 4.2 KB
inode.c -rw-r--r-- 40.2 KB
internal.h -rw-r--r-- 1.5 KB
ioctl.c -rw-r--r-- 13.9 KB
ioprio.c -rw-r--r-- 5.2 KB
libfs.c -rw-r--r-- 20.5 KB
locks.c -rw-r--r-- 57.6 KB
mbcache.c -rw-r--r-- 18.3 KB
mpage.c -rw-r--r-- 19.9 KB
namei.c -rw-r--r-- 70.0 KB
namespace.c -rw-r--r-- 58.0 KB
nfsctl.c -rw-r--r-- 2.5 KB
no-block.c -rw-r--r-- 663 bytes
open.c -rw-r--r-- 26.9 KB
pipe.c -rw-r--r-- 24.1 KB
pnode.c -rw-r--r-- 8.9 KB
pnode.h -rw-r--r-- 1.1 KB
posix_acl.c -rw-r--r-- 8.4 KB
quota.c -rw-r--r-- 12.3 KB
quota_tree.c -rw-r--r-- 16.6 KB
quota_tree.h -rw-r--r-- 689 bytes
quota_v1.c -rw-r--r-- 6.1 KB
quota_v2.c -rw-r--r-- 7.0 KB
quotaio_v1.h -rw-r--r-- 1.2 KB
quotaio_v2.h -rw-r--r-- 1.9 KB
read_write.c -rw-r--r-- 18.8 KB
read_write.h -rw-r--r-- 542 bytes
readdir.c -rw-r--r-- 6.9 KB
select.c -rw-r--r-- 23.0 KB
seq_file.c -rw-r--r-- 13.6 KB
signalfd.c -rw-r--r-- 7.1 KB
splice.c -rw-r--r-- 38.9 KB
stack.c -rw-r--r-- 1.1 KB
stat.c -rw-r--r-- 10.6 KB
super.c -rw-r--r-- 23.2 KB
sync.c -rw-r--r-- 8.4 KB
timerfd.c -rw-r--r-- 6.8 KB
utimes.c -rw-r--r-- 5.6 KB
xattr.c -rw-r--r-- 14.9 KB
xattr_acl.c -rw-r--r-- 2.3 KB

back to top