Revision a684e7d33096892093456dd56a582cfc3bfad648 authored by Geert Uytterhoeven on 06 November 2008, 20:53:37 UTC, committed by Linus Torvalds on 06 November 2008, 23:41:19 UTC
commit 3e680aae4e53ab54cdbb0c29257dae0cbb158e1c ("fb: convert
lock/unlock_kernel() into local fb mutex") introduced several deadlocks
in the fb_compat_ioctl() path, as mutex_lock() doesn't allow recursion,
unlike lock_kernel().  This broke frame buffer applications on 64-bit
systems with a 32-bit userland.

commit 120a37470c2831fea49fdebaceb5a7039f700ce6 ("framebuffer compat_ioctl
deadlock") fixed one of the deadlocks.

This patch fixes the remaining deadlocks:
  - Revert commit 120a37470c2831fea49fdebaceb5a7039f700ce6,
  - Extract the core logic of fb_ioctl() into a new function do_fb_ioctl(),
  - Change all callsites of fb_ioctl() where info->lock is already held to
    call do_fb_ioctl() instead,
  - Add sparse annotations to all routines that take info->lock.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a70dcb9
History
File Mode Size
9p
adfs
affs
afs
autofs
autofs4
befs
bfs
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
msdos
ncpfs
nfs
nfs_common
nfsd
nls
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
ramfs
reiserfs
romfs
smbfs
sysfs
sysv
ubifs
udf
ufs
vfat
xfs
Kconfig -rw-r--r-- 54.5 KB
Kconfig.binfmt -rw-r--r-- 6.4 KB
Makefile -rw-r--r-- 4.0 KB
aio.c -rw-r--r-- 45.9 KB
anon_inodes.c -rw-r--r-- 4.9 KB
attr.c -rw-r--r-- 4.8 KB
bad_inode.c -rw-r--r-- 8.0 KB
binfmt_aout.c -rw-r--r-- 14.7 KB
binfmt_elf.c -rw-r--r-- 53.6 KB
binfmt_elf_fdpic.c -rw-r--r-- 48.0 KB
binfmt_em86.c -rw-r--r-- 2.8 KB
binfmt_flat.c -rw-r--r-- 26.6 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-- 19.9 KB
bio.c -rw-r--r-- 34.1 KB
block_dev.c -rw-r--r-- 31.9 KB
buffer.c -rw-r--r-- 87.8 KB
char_dev.c -rw-r--r-- 13.2 KB
compat.c -rw-r--r-- 53.1 KB
compat_binfmt_elf.c -rw-r--r-- 3.4 KB
compat_ioctl.c -rw-r--r-- 81.0 KB
dcache.c -rw-r--r-- 60.0 KB
dcookies.c -rw-r--r-- 6.3 KB
direct-io.c -rw-r--r-- 34.0 KB
dnotify.c -rw-r--r-- 4.6 KB
dquot.c -rw-r--r-- 62.0 KB
drop_caches.c -rw-r--r-- 1.6 KB
eventfd.c -rw-r--r-- 5.3 KB
eventpoll.c -rw-r--r-- 36.0 KB
exec.c -rw-r--r-- 41.9 KB
fcntl.c -rw-r--r-- 13.4 KB
fifo.c -rw-r--r-- 3.2 KB
file.c -rw-r--r-- 12.1 KB
file_table.c -rw-r--r-- 10.0 KB
filesystems.c -rw-r--r-- 6.3 KB
fs-writeback.c -rw-r--r-- 22.4 KB
generic_acl.c -rw-r--r-- 4.2 KB
inode.c -rw-r--r-- 37.7 KB
inotify.c -rw-r--r-- 20.2 KB
inotify_user.c -rw-r--r-- 18.8 KB
internal.h -rw-r--r-- 1.4 KB
ioctl.c -rw-r--r-- 12.1 KB
ioprio.c -rw-r--r-- 5.0 KB
libfs.c -rw-r--r-- 20.6 KB
locks.c -rw-r--r-- 57.6 KB
mbcache.c -rw-r--r-- 18.3 KB
mpage.c -rw-r--r-- 19.8 KB
namei.c -rw-r--r-- 69.2 KB
namespace.c -rw-r--r-- 58.0 KB
nfsctl.c -rw-r--r-- 2.4 KB
no-block.c -rw-r--r-- 663 bytes
open.c -rw-r--r-- 26.3 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.5 KB
quota.c -rw-r--r-- 12.2 KB
quota_v1.c -rw-r--r-- 5.9 KB
quota_v2.c -rw-r--r-- 20.2 KB
read_write.c -rw-r--r-- 18.0 KB
read_write.h -rw-r--r-- 542 bytes
readdir.c -rw-r--r-- 6.9 KB
select.c -rw-r--r-- 21.4 KB
seq_file.c -rw-r--r-- 13.0 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-- 22.9 KB
sync.c -rw-r--r-- 7.1 KB
timerfd.c -rw-r--r-- 6.8 KB
utimes.c -rw-r--r-- 5.6 KB
xattr.c -rw-r--r-- 15.0 KB
xattr_acl.c -rw-r--r-- 2.3 KB

back to top