linux/fs/sysfs
Hugh Dickins 095160aee9 sysfs: fix some bin_vm_ops errors
Commit 86c9508eb1c0ce5aa07b5cf1d36b60c54efc3d7a
"sysfs: don't block indefinitely for unmapped files" in linux-next
crashes the PowerMac G5 when X starts up.  It's caught out by the way
powerpc's pci_mmap of legacy_mem uses shmem_zero_setup(), substituting
a new vma->vm_file whose private_data no longer points to the bin_buffer
(substitution done because some versions of X crash if that mmap fails).

The fix to this is straightforward: the original vm_file is fput() in
that case, so this mmap won't block sysfs at all, so just don't switch
over to bin_vm_ops if vm_file has changed.

But more fixes made before realizing that was the problem:-

It should not be an error if bin_page_mkwrite() finds no underlying
page_mkwrite().

Check that a file already mmap'ed has the same underlying vm_ops
_before_ pointing vma->vm_ops at bin_vm_ops.

If the file being mmap'ed is a shmem/tmpfs file, don't fail the mmap
on CONFIG_NUMA=y, just because that has a set_policy and get_policy:
provide bin_set_policy, bin_get_policy and bin_migrate.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Eric Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-24 16:38:26 -07:00
..
bin.c sysfs: fix some bin_vm_ops errors 2009-03-24 16:38:26 -07:00
dir.c sysfs: don't block indefinitely for unmapped files. 2009-03-24 16:38:26 -07:00
file.c sysfs: only allow one scheduled removal callback per kobj 2009-03-24 16:38:26 -07:00
group.c Use WARN() in fs/sysfs 2008-07-26 12:00:07 -07:00
inode.c sysfs: reference sysfs_dirent from sysfs inodes 2009-03-24 16:38:25 -07:00
Kconfig fs/Kconfig: move sysfs out 2009-01-22 13:15:56 +03:00
Makefile
mount.c sysfs: reference sysfs_dirent from sysfs inodes 2009-03-24 16:38:25 -07:00
symlink.c driver core: Suppress sysfs warnings for device_rename(). 2008-07-21 21:55:01 -07:00
sysfs.h sysfs: don't block indefinitely for unmapped files. 2009-03-24 16:38:26 -07:00