aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-05-27regulator: Add missing platform_set_drvdata in tps6105x_regulator_probeAxel Lin1-0/+1
Otherwise, calling platform_get_drvdata in tps6105x_regulator_remove returns NULL. Signed-off-by: Axel Lin <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
2011-05-27regulator: When constraining modes fall back to higher power modesMark Brown1-9/+15
If a mode requested by a consumer is not allowed by constraints automatically fall back to a higher power mode if possible. This ensures that consumers get at least the output they requested while allowing machine drivers to transparently limit lower power modes if required. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
2011-05-27hwmon: (coretemp) Fix section mismatchJean Delvare1-1/+1
chk_ucode_version() is only called from coretemp_probe() which is __devinit, so it can be marked __devinit too. Signed-off-by: Jean Delvare <[email protected]> Cc: Durgadoss R <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-05-27hwmon: (pmbus) Initialize sysfs attributesGuenter Roeck1-0/+1
Initialize sysfs attrs before device_create_file() call to suppress lockdep_init_map() warning: WARNING: at kernel/lockdep.c:2701 lockdep_init_map+0x12d/0x140() Reviewed-by: Robert Coulson <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Cc: [email protected] # .39.x
2011-05-27hwmon: (coretemp) Update comments describing the handling of HT CPUsGuenter Roeck1-6/+6
Update comments describing the handling of HT CPUs based on review feedback. Signed-off-by: Guenter Roeck <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Durgadoss R <[email protected]> Acked-by: Jean Delvare <[email protected]>
2011-05-27hwmon: (coretemp) Initialize sysfs attributesSergey Senozhatsky1-0/+2
Initialize sysfs attrs before device_create_file() call to suppress lockdep_init_map() warning: [ 3.653628] WARNING: at kernel/lockdep.c:2885 lockdep_init_map+0xea/0x43c() [ 3.653698] Modules linked in: [ 3.654835] Pid: 1, comm: swapper Not tainted 2.6.39-dbg-git8-05624-g46187f8 #576 [ 3.656014] Call Trace: [ 3.657139] [<ffffffff8103e4b4>] warn_slowpath_common+0x7e/0x96 [ 3.658298] [<ffffffff8103e4e1>] warn_slowpath_null+0x15/0x17 [ 3.659460] [<ffffffff8106d7b9>] lockdep_init_map+0xea/0x43c [ 3.660616] [<ffffffff81163c1a>] sysfs_add_file_mode+0x5d/0xa8 [ 3.661785] [<ffffffff81163c71>] sysfs_add_file+0xc/0xe [ 3.662929] [<ffffffff81163d26>] sysfs_create_file+0x23/0x25 [ 3.664045] [<ffffffff813724d1>] device_create_file+0x14/0x16 [ 3.665172] [<ffffffff81460ed4>] coretemp_probe+0xf9/0x185 [ 3.666306] [<ffffffff8137638e>] platform_drv_probe+0x12/0x14 [ 3.667420] [<ffffffff81375321>] driver_probe_device+0xb0/0x14b [ 3.668542] [<ffffffff8137546d>] __device_attach+0x35/0x3a [ 3.669710] [<ffffffff81375438>] ? __driver_attach+0x7c/0x7c [ 3.670816] [<ffffffff8137426b>] bus_for_each_drv+0x54/0x88 [ 3.671921] [<ffffffff81375231>] device_attach+0x77/0x9b [ 3.673027] [<ffffffff81374aef>] bus_probe_device+0x22/0x39 [ 3.674137] [<ffffffff81373235>] device_add+0x3c1/0x550 [ 3.675249] [<ffffffff81371ed9>] ? dev_set_name+0x3c/0x3e [ 3.676371] [<ffffffff813769f3>] platform_device_add+0x10c/0x156 [ 3.677491] [<ffffffff8146af9c>] get_core_online+0xab/0x16e [ 3.678608] [<ffffffff81ad8070>] coretemp_init+0x4b/0x80 [ 3.679724] [<ffffffff81ad8025>] ? hwmon_init+0xee/0xee [ 3.680853] [<ffffffff8100020a>] do_one_initcall+0x7a/0x13c [ 3.681975] [<ffffffff81aaac74>] kernel_init+0xe1/0x15b [ 3.683081] [<ffffffff8147e4e4>] kernel_thread_helper+0x4/0x10 [ 3.684174] [<ffffffff8102d48c>] ? finish_task_switch+0x76/0xf0 [ 3.685266] [<ffffffff81477918>] ? retint_restore_args+0x13/0x13 [ 3.686356] [<ffffffff81aaab93>] ? start_kernel+0x3ee/0x3ee [ 3.687425] [<ffffffff8147e4e0>] ? gs_change+0x13/0x13 [ 3.688489] ---[ end trace 7392ad3e6a92ae39 ]--- Signed-off-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-05-27Merge branch 'move_extents' of git://oss.oracle.com/git/tye/linux-2.6 into ↵Joel Becker1-21/+20
ocfs2-merge-window
2011-05-27Ocfs2/move_extents: Validate moving goal after the adjustment.Tristan Ye1-13/+13
though the goal_to_be_moved will be validated again in following moving, it's still a good idea to validate it after adjustment at the very beginning, instead of validating it before adjustment. Signed-off-by: Tristan Ye <[email protected]>
2011-05-27Ocfs2/move_extents: Avoid doing division in extent moving.Tristan Ye1-10/+9
It's not wise enough to do a 64bits division anywhere in kernside, replace it with a decent helper or proper shifts. Signed-off-by: Tristan Ye <[email protected]>
2011-05-27Merge branch 'fix/asoc' into for-linusTakashi Iwai7-43/+66
2011-05-27Merge branch 'fix/misc' into for-linusTakashi Iwai14-55/+157
2011-05-27[CIFS] Rename three structures to avoid camel caseSteve French24-353/+353
secMode to sec_mode and cifsTconInfo to cifs_tcon and cifsSesInfo to cifs_ses Signed-off-by: Steve French <[email protected]>
2011-05-27Fix extended security auth failureSteve French1-11/+6
Fix authentication failures using extended security mechanisms. cifs client does not take into consideration extended security bit in capabilities field in negotiate protocol response from the server. Please refer to Samba bugzilla 8046. Reported-and-tested by: Werner Maes <[email protected]> Signed-off-by: Shirish Pargaonkar <[email protected]> Signed-off-by: Steve French <[email protected]>
2011-05-27CIFS: Add rwpidforward mount optionPavel Shilovsky10-39/+115
Add rwpidforward mount option that switches on a mode when we forward pid of a process who opened a file to any read and write operation. This can prevent applications like WINE from failing on read or write operation on a previously locked file region from the same netfd from another process if we use mandatory brlock style. It is actual for WINE because during a run of WINE program two processes work on the same netfd - share the same file struct between several VFS fds: 1) WINE-server does open and lock; 2) WINE-application does read and write. Signed-off-by: Pavel Shilovsky <[email protected]> Signed-off-by: Steve French <[email protected]>
2011-05-27CIFS: Migrate to shared superblock modelPavel Shilovsky3-1/+139
Add cifs_match_super to use in sget to share superblock between mounts that have the same //server/sharename, credentials and mount options. It helps us to improve performance on work with future SMB2.1 leases. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Pavel Shilovsky <[email protected]> Signed-off-by: Steve French <[email protected]>
2011-05-27[CIFS] Migrate from prefixpath logicSteve French7-148/+189
Now we point superblock to a server share root and set a root dentry appropriately. This let us share superblock between mounts like //server/sharename/foo/bar and //server/sharename/foo further. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Pavel Shilovsky <[email protected]> Signed-off-by: Steve French <[email protected]>
2011-05-27CIFS: Fix memory leak in cifs_do_mountPavel Shilovsky1-9/+10
and simplify error handling code. Signed-off-by: Pavel Shilovsky <[email protected]> Signed-off-by: Steve French <[email protected]>
2011-05-26Merge branch 'upstream/tidy-xen-mmu-2.6.39' of ↵Linus Torvalds3-275/+50
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen * 'upstream/tidy-xen-mmu-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: xen: fix compile without CONFIG_XEN_DEBUG_FS Use arbitrary_virt_to_machine() to deal with ioremapped pud updates. Use arbitrary_virt_to_machine() to deal with ioremapped pmd updates. xen/mmu: remove all ad-hoc stats stuff xen: use normal virt_to_machine for ptes xen: make a pile of mmu pvop functions static vmalloc: remove vmalloc_sync_all() from alloc_vm_area() xen: condense everything onto xen_set_pte xen: use mmu_update for xen_set_pte_at() xen: drop all the special iomap pte paths.
2011-05-26selinux: don't pass in NULL avd to avc_has_perm_noauditLinus Torvalds2-11/+4
Right now security_get_user_sids() will pass in a NULL avd pointer to avc_has_perm_noaudit(), which then forces that function to have a dummy entry for that case and just generally test it. Don't do it. The normal callers all pass a real avd pointer, and this helper function is incredibly hot. So don't make avc_has_perm_noaudit() do conditional stuff that isn't needed for the common case. This also avoids some duplicated stack space. Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linusLinus Torvalds23-151/+203
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus: Squashfs: update email address Squashfs: add extra sanity checks at mount time Squashfs: add sanity checks to fragment reading at mount time Squashfs: add sanity checks to lookup table reading at mount time Squashfs: add sanity checks to id reading at mount time Squashfs: add sanity checks to xattr reading at mount time Squashfs: reverse order of filesystem table reading Squashfs: move table allocation into squashfs_read_table()
2011-05-26m68knommu: use generic find_next_bit_le()Akinobu Mita1-44/+2
The implementation of find_next_bit_le() on m68knommu is identical with the generic implementation of find_next_bit_le(). Signed-off-by: Akinobu Mita <[email protected]> Cc: Greg Ungerer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26s390: use asm-generic/bitops/le.hAkinobu Mita1-35/+2
The previous style change enables to use asm-generic/bitops/le.h on s390. Signed-off-by: Akinobu Mita <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Russell King <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Greg Ungerer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26arm: use asm-generic/bitops/le.hAkinobu Mita1-38/+5
The previous style change enables to use asm-generic/bitops/le.h on arm. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Russell King <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Greg Ungerer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT}Akinobu Mita24-126/+2
By the previous style change, CONFIG_GENERIC_FIND_NEXT_BIT, CONFIG_GENERIC_FIND_BIT_LE, and CONFIG_GENERIC_FIND_LAST_BIT are not used to test for existence of find bitops anymore. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Greg Ungerer <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Russell King <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26bitops: add #ifndef for each of find bitopsAkinobu Mita5-0/+29
The style that we normally use in asm-generic is to test the macro itself for existence, so in asm-generic, do: #ifndef find_next_zero_bit_le extern unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset); #endif and in the architectures, write static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) #define find_next_zero_bit_le find_next_zero_bit_le This adds the #ifndef for each of the find bitops in the generic header and source files. Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Russell King <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Greg Ungerer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26arch: add #define for each of optimized find bitopsAkinobu Mita5-0/+36
The style that we normally use in asm-generic is to test the macro itself for existence, so in asm-generic, do: #ifndef find_next_zero_bit_le extern unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset); #endif and in the architectures, write static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) #define find_next_zero_bit_le find_next_zero_bit_le This adds the #define for each of the optimized find bitops in the architectures. Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Hans-Christian Egtvedt <[email protected]> Acked-by: Russell King <[email protected]> Acked-by: Greg Ungerer <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26m68knommu: fix build error due to the lack of find_next_bit_le()Akinobu Mita1-0/+44
m68knommu can't build ext4, udf, and ocfs2 due to the lack of find_next_bit_le(). This implements find_next_bit_le() on m68knommu by duplicating the generic find_next_bit_le() in lib/find_next_bit.c. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Greg Ungerer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC supportClifton Barnes8-0/+1222
Add support for the Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC. It was suggested to combine this functionality with the current ds2782 driver. Unfortunately, I'm unable to commit the time to refactoring this driver to that extent and I don't have a platform with the ds2782 part to validate that there are no regression issues by adding this functionality. [[email protected]: use min_t()] Signed-off-by: Clifton Barnes <[email protected]> Tested-by: Haojian Zhuang <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: Ryan Mallon <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26w1: have netlink search update kernel listDavid Fries3-5/+16
Reorganize so the netlink connector one wire search command will update the kernel list of detected slave devices. Otherwise, a newly detected device is unusable because unless it's in the kernel list of known devices any commands will result in ENODEV status. Signed-off-by: David Fries <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26w1: complete the 1-wire (w1) ds1wm driver search algorithmJean-François Dagenais2-103/+220
This adds multi-slave support of the w1 bus for the ds1wm Synthesizable 1-Wire Bus Master. Also many fixes and tweaks based on the rev3 of the datasheet http://datasheets.maxim-ic.com/en/ds/DS1WM.pdf Signed-off-by: Jean-François Dagenais <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: Szabolcs Gyurko <[email protected]> Cc: Matt Reimer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26w1: add 1-wire (w1) DS2408 8-Channel Addressable Switch supportJean-François Dagenais4-0/+411
This DS2408 w1 slave driver is not complete for all the features of the chip, but its sufficient if you use it as a simple IO expander. [[email protected]: fix w1_ds2408.c printk formats] Signed-off-by: Jean-François Dagenais <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: Szabolcs Gyurko <[email protected]> Cc: Matt Reimer <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26w1: add 1-wire (w1) reset and resume command API supportJean-François Dagenais2-0/+28
The first patch adds generic functionnality to w1_io for Resume Command [A5h] lots of slaves support. I found it useful for multi-commands/reset workflows with the same slave on a multi-slave bus. This DS2408 w1 slave driver is not complete for all the features of the chip, but its sufficient if you use it as a simple IO expander. Enjoy! The ds1wm had Kconfig dependencies towards ARM && HAVE_CLK. I took them out since I was using the ds1wm on an x86_64 platform (ds1wm in a FPGA through pcie) and found them irrelevant. The clock freq/divisors at the top of ds1wm.c did not have the MSB set to 1. This bit is CLK_EN which turns the whole prescaler and dividers on. The driver never mentionned this bit either, so I just included this bit right in the table entries. I also took the liberty to add a couple of entries to the table. The spec doesn't explicitely mentions these possibilities but the description and examination of the core shows the prescalers & dividers can be used for more than the table explicitely shows. The table I enlarged still doesn't cover all possibilities, but it's a good start. I also made a few tweaks to a couple of the read and write algorithms which made sense while I had my head very deep in the ds1wm documentation. We stressed it a lot with 10+ slaves on the bus, many ds2408, ds2431 and ds2433 at the same time doing extensive interaction. It proved quite stable in our production environment. This patch: Add generic functionnality to w1_io for Resume Command [A5h] lots of slaves support. Signed-off-by: Jean-François Dagenais <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: Szabolcs Gyurko <[email protected]> Cc: Matt Reimer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26kernel/profile.c: remove some duplicate code from profile_hits()Rakib Mullick1-7/+9
profile_hits() has a common check for prof_on and prof_buffer regardless of SMP or !SMP. So, remove some duplicate code by splitting profile_hits into two. [[email protected]: make do_profile_hits static] Signed-off-by: Rakib Mullick <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26drivers/char/ppdev.c: put gotten port valueJulia Lawall1-0/+1
parport_find_number() calls parport_get_port() on its result, so there should be a corresponding call to parport_put_port() before dropping the reference. Similar code is found in the function register_device() in the same file. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @exists@ local idexpression struct parport * x; expression ra,rr; statement S1,S2; @@ x = parport_find_number(...) ... when != x = rr when any when != parport_put_port(x,...) when != if (...) { ... parport_put_port(x,...) ...} ( if(<+...x...+>) S1 else S2 | if(...) { ... when != x = ra when forall when != parport_put_port(x,...) *return...; } ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26edac,rcu: use synchronize_rcu() instead of call_rcu()+rcu_barrier()Lai Jiangshan4-55/+18
synchronize_rcu() does the stuff as needed. Signed-off-by: Lai Jiangshan <[email protected]> Cc: Doug Thompson <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26pid: fix typo in function descriptionSisir Koppaka1-1/+1
finds is misspelt as finr. No functional change. Signed-off-by: Sisir Koppaka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oopsTimo Warns1-0/+9
The kernel automatically evaluates partition tables of storage devices. The code for evaluating GUID partitions (in fs/partitions/efi.c) contains a bug that causes a kernel oops on certain corrupted GUID partition tables. This bug has security impacts, because it allows, for example, to prepare a storage device that crashes a kernel subsystem upon connecting the device (e.g., a "USB Stick of (Partial) Death"). crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size)); computes a CRC32 checksum over gpt covering (*gpt)->header_size bytes. There is no validation of (*gpt)->header_size before the efi_crc32 call. A corrupted partition table may have large values for (*gpt)->header_size. In this case, the CRC32 computation access memory beyond the memory allocated for gpt, which may cause a kernel heap overflow. Validate value of GUID partition table header size. [[email protected]: fix layout and indenting] Signed-off-by: Timo Warns <[email protected]> Cc: Matt Domsch <[email protected]> Cc: Eugene Teo <[email protected]> Cc: Dave Jones <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26drivers/char/mspec.c: use {k,v}zalloc to allocate memoryRakib Mullick1-3/+2
Let memory allocator initialize the allocated memory as null, thus remove the use of memset. Signed-off-by: Rakib Mullick <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26ipmi: convert to seq_file interfaceAlexey Dobriyan3-86/+142
The ->read_proc interface is going away, convert to seq_file. Signed-off-by: Alexey Dobriyan <[email protected]> Cc:Corey Minyard <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26fs/proc/vmcore.c: add hook to read_from_oldmem() to check for non-ram pagesOlaf Hering2-3/+54
The balloon driver in a Xen guest frees guest pages and marks them as mmio. When the kernel crashes and the crash kernel attempts to read the oldmem via /proc/vmcore a read from ballooned pages will generate 100% load in dom0 because Xen asks qemu-dm for the page content. Since the reads come in as 8byte requests each ballooned page is tried 512 times. With this change a hook can be registered which checks wether the given pfn is really ram. The hook has to return a value > 0 for ram pages, a value < 0 on error (because the hypercall is not known) and 0 for non-ram pages. This will reduce the time to read /proc/vmcore. Without this change a 512M guest with 128M crashkernel region needs 200 seconds to read it, with this change it takes just 2 seconds. Signed-off-by: Olaf Hering <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26proc: fix pagemap_read() error caseKOSAKI Motohiro1-10/+9
Currently, pagemap_read() has three error and/or corner case handling mistake. (1) If ppos parameter is wrong, mm refcount will be leak. (2) If count parameter is 0, mm refcount will be leak too. (3) If the current task is sleeping in kmalloc() and the system is out of memory and oom-killer kill the proc associated task, mm_refcount prevent the task free its memory. then system may hang up. <Quote Hugh's explain why we shold call kmalloc() before get_mm()> check_mem_permission gets a reference to the mm. If we __get_free_page after check_mem_permission, imagine what happens if the system is out of memory, and the mm we're looking at is selected for killing by the OOM killer: while we wait in __get_free_page for more memory, no memory is freed from the selected mm because it cannot reach exit_mmap while we hold that reference. This patch fixes the above three. Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Jovi Zhang <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: Stephen Wilson <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26proc: put check_mem_permission after __get_free_page in mem_writeKOSAKI Motohiro1-7/+9
It whould be better if put check_mem_permission after __get_free_page in mem_write, to be same as function mem_read. Hugh Dickins explained the reason. check_mem_permission gets a reference to the mm. If we __get_free_page after check_mem_permission, imagine what happens if the system is out of memory, and the mm we're looking at is selected for killing by the OOM killer: while we wait in __get_free_page for more memory, no memory is freed from the selected mm because it cannot reach exit_mmap while we hold that reference. Reported-by: Jovi Zhang <[email protected]> Signed-off-by: KOSAKI Motohiro <[email protected]> Acked-by: Hugh Dickins <[email protected]> Reviewed-by: Stephen Wilson <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26proc/stat: use defined macro KMALLOC_MAX_SIZEYuanhan Liu1-3/+3
There is a macro for the max size kmalloc can allocate, so use it instead of a hardcoded number. Signed-off-by: Yuanhan Liu <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26proc: constify status arrayMike Frysinger1-2/+2
No need for this local array to be writable, so mark it const. Signed-off-by: Mike Frysinger <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26fs/proc: convert to kstrtoX()Alexey Dobriyan2-11/+13
Convert fs/proc/ from strict_strto*() to kstrto*() functions. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26coredump: add support for exe_file in core nameJiri Slaby2-1/+40
Now, exe_file is not proc FS dependent, so we can use it to name core file. So we add %E pattern for core file name cration which extract path from mm_struct->exe_file. Then it converts slashes to exclamation marks and pastes the result to the core file name itself. This is useful for environments where binary names are longer than 16 character (the current->comm limitation). Also where there are binaries with same name but in a different path. Further in case the binery itself changes its current->comm after exec. So by doing (s/$/#/ -- # is treated as git comment): $ sysctl kernel.core_pattern='core.%p.%e.%E' $ ln /bin/cat cat45678901234567890 $ ./cat45678901234567890 ^Z $ rm cat45678901234567890 $ fg ^\Quit (core dumped) $ ls core* we now get: core.2434.cat456789012345.!root!cat45678901234567890 (deleted) Signed-off-by: Jiri Slaby <[email protected]> Cc: Al Viro <[email protected]> Cc: Alan Cox <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26mm: extract exe_file handling from procfsJiri Slaby6-82/+53
Setup and cleanup of mm_struct->exe_file is currently done in fs/proc/. This was because exe_file was needed only for /proc/<pid>/exe. Since we will need the exe_file functionality also for core dumps (so core name can contain full binary path), built this functionality always into the kernel. To achieve that move that out of proc FS to the kernel/ where in fact it should belong. By doing that we can make dup_mm_exe_file static. Also we can drop linux/proc_fs.h inclusion in fs/exec.c and kernel/fork.c. Signed-off-by: Jiri Slaby <[email protected]> Cc: Alexander Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26kgdbts: unify/generalize gdb breakpoint adjustmentMike Frysinger4-18/+14
The Blackfin arch, like the x86 arch, needs to adjust the PC manually after a breakpoint is hit as normally this is handled by the remote gdb. However, rather than starting another arch ifdef mess, create a common GDB_ADJUSTS_BREAK_OFFSET define for any arch to opt-in via their kgdb.h. Signed-off-by: Mike Frysinger <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Acked-by: Paul Mundt <[email protected]> Acked-by: Dongdong Deng <[email protected]> Cc: Sergei Shtylyov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26sh: convert to asm-generic ptrace.hMike Frysinger1-2/+4
Signed-off-by: Mike Frysinger <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: Dongdong Deng <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-26x86: convert to asm-generic ptrace.hMike Frysinger1-13/+5
Signed-off-by: Mike Frysinger <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: Dongdong Deng <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>