aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* mm, show_mem: suppress page counts in non-blockable contextsDavid Rientjes2013-11-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On large systems with a lot of memory, walking all RAM to determine page types may take a half second or even more. In non-blockable contexts, the page allocator will emit a page allocation failure warning unless __GFP_NOWARN is specified. In such contexts, irqs are typically disabled and such a lengthy delay may even result in NMI watchdog timeouts. To fix this, suppress the page walk in such contexts when printing the page allocation failure warning. Signed-off-by: David Rientjes <rientjes@google.com> Cc: Mel Gorman <mgorman@suse.de> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: I86f3a3334db2021345fdc41cc7c7c250ce0de0b2 Reviewed-on: http://gerrit.pcs.mot.com/577684 Submit-Approved: Jira Key <jirakey@motorola.com> Tested-by: Jira Key <jirakey@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Reviewed-by: Ravikumar Vembu <raviv@motorola.com> Reviewed-by: David Ding <dding@motorola.com> SLTApproved: Christopher Fries <c.fries@motorola.com>
* Merge M8960AAAAANLYD23121 to mjb-mr2-qcproYinjun Chen2013-09-064-0/+569
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/arm/Kconfig arch/arm/configs/msm8960_defconfig arch/arm/mach-msm/Makefile drivers/gpu/msm/adreno.c drivers/usb/misc/ks_bridge.c drivers/usb/serial/csvt.c Change-Id: I243fd26ff5703686cbf1751de132546c31115bea
| * lib: qmi: Introduce QMI Encode/Decode libraryKarthikeyan Ramasubramanian2013-08-094-0/+569
| | | | | | | | | | | | | | | | | | | | Introduce Encode/Decode Library to perform QMI message marshaling. The QMI Encode/Decode Library encodes the kernel C data structures into QMI wire format and decodes the messages in QMI wire format into kernel C structures. Change-Id: Ib443e697dafedeac8a790de9a3a8ed4a8444082f Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
* | klist: del waiter from klist_remove_waiters before wakeup waitting processwang, biao2013-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race between klist_remove and klist_release. klist_remove uses a local var waiter saved on stack. When klist_release calls wake_up_process(waiter->process) to wake up the waiter, waiter might run immediately and reuse the stack. Then, klist_release calls list_del(&waiter->list) to change previous wait data and cause prior waiter thread corrupt. The patch fixes it against kernel 3.9. Signed-off-by: wang, biao <biao.wang@intel.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I273ccbb8d16b20d007e5b1d2ae1666370a359d09 Reviewed-on: http://gerrit.pcs.mot.com/540077 SLT-Approved: Slta Waiver <sltawvr@motorola.com> Submit-Approved: Jira Key <jirakey@motorola.com> Tested-by: Jira Key <jirakey@motorola.com> Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com> Reviewed-by: Check Patch <CHEKPACH@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
* | Merge tag 'v3.4.42' into kernel-3.4.39Igor Kovalenko2013-04-301-1/+8
|\ \ | | | | | | | | | This is the 3.4.42 stable release
| * | kobject: fix kset_find_obj() race with concurrent last kobject_put()Linus Torvalds2013-04-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit a49b7e82cab0f9b41f483359be83f44fbb6b4979 upstream. Anatol Pomozov identified a race condition that hits module unloading and re-loading. To quote Anatol: "This is a race codition that exists between kset_find_obj() and kobject_put(). kset_find_obj() might return kobject that has refcount equal to 0 if this kobject is freeing by kobject_put() in other thread. Here is timeline for the crash in case if kset_find_obj() searches for an object tht nobody holds and other thread is doing kobject_put() on the same kobject: THREAD A (calls kset_find_obj()) THREAD B (calls kobject_put()) splin_lock() atomic_dec_return(kobj->kref), counter gets zero here ... starts kobject cleanup .... spin_lock() // WAIT thread A in kobj_kset_leave() iterate over kset->list atomic_inc(kobj->kref) (counter becomes 1) spin_unlock() spin_lock() // taken // it does not know that thread A increased counter so it remove obj from list spin_unlock() vfree(module) // frees module object with containing kobj // kobj points to freed memory area!! kobject_put(kobj) // OOPS!!!! The race above happens because module.c tries to use kset_find_obj() when somebody unloads module. The module.c code was introduced in commit 6494a93d55fa" Anatol supplied a patch specific for module.c that worked around the problem by simply not using kset_find_obj() at all, but rather than make a local band-aid, this just fixes kset_find_obj() to be thread-safe using the proper model of refusing the get a new reference if the refcount has already dropped to zero. See examples of this proper refcount handling not only in the kref documentation, but in various other equivalent uses of this pattern by grepping for atomic_inc_not_zero(). [ Side note: the module race does indicate that module loading and unloading is not properly serialized wrt sysfs information using the module mutex. That may require further thought, but this is the correct fix at the kobject layer regardless. ] Reported-analyzed-and-tested-by: Anatol Pomozov <anatol.pomozov@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | Merge tag 'v3.4.39' into kernel-3.4.39Igor Kovalenko2013-04-299-27/+56
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the 3.4.39 stable release Conflicts: arch/arm/Kconfig arch/arm/kernel/traps.c arch/arm/mm/mmu.c arch/arm/mm/tlb-v7.S arch/arm/vfp/entry.S arch/arm/vfp/vfpmodule.c block/partition-generic.c drivers/base/power/main.c drivers/bluetooth/ath3k.c drivers/bluetooth/btusb.c drivers/gpu/drm/radeon/radeon_mode.h drivers/mmc/card/block.c drivers/mmc/host/sdhci.c drivers/net/tun.c drivers/usb/core/hub.c drivers/usb/core/message.c drivers/usb/host/xhci.h fs/ubifs/dir.c include/linux/sched.h kernel/cgroup.c kernel/power/suspend.c kernel/sched/core.c net/bluetooth/hci_conn.c net/bluetooth/hci_event.c net/bluetooth/l2cap_core.c net/bluetooth/mgmt.c net/bluetooth/rfcomm/sock.c net/bluetooth/smp.c Change-Id: I169eac4005b369c166f82bc437995cf3038b7a64
| * | idr: fix a subtle bug in idr_get_next()Tejun Heo2013-03-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6cdae7416a1c45c2ce105a78187d9b7e8feb9e24 upstream. The iteration logic of idr_get_next() is borrowed mostly verbatim from idr_for_each(). It walks down the tree looking for the slot matching the current ID. If the matching slot is not found, the ID is incremented by the distance of single slot at the given level and repeats. The implementation assumes that during the whole iteration id is aligned to the layer boundaries of the level closest to the leaf, which is true for all iterations starting from zero or an existing element and thus is fine for idr_for_each(). However, idr_get_next() may be given any point and if the starting id hits in the middle of a non-existent layer, increment to the next layer will end up skipping the same offset into it. For example, an IDR with IDs filled between [64, 127] would look like the following. [ 0 64 ... ] /----/ | | | NULL [ 64 ... 127 ] If idr_get_next() is called with 63 as the starting point, it will try to follow down the pointer from 0. As it is NULL, it will then try to proceed to the next slot in the same level by adding the slot distance at that level which is 64 - making the next try 127. It goes around the loop and finds and returns 127 skipping [64, 126]. Note that this bug also triggers in idr_for_each_entry() loop which deletes during iteration as deletions can make layers go away leaving the iteration with unaligned ID into missing layers. Fix it by ensuring proceeding to the next slot doesn't carry over the unaligned offset - ie. use round_up(id + 1, slot_distance) instead of id += slot_distance. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: David Teigland <teigland@redhat.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | digsig: Fix memory leakage in digsig_verify_rsa()YOSHIFUJI Hideaki2013-02-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 7810cc1e7721220f1ed2a23ca95113d6434f6dcd upstream. digsig_verify_rsa() does not free kmalloc'ed buffer returned by mpi_get_buffer(). Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | lib: atomic64: Initialize locks statically to fix early usersStephen Boyd2013-01-111-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit fcc16882ac4532aaa644bff444f0c5d6228ba71e upstream. The atomic64 library uses a handful of static spin locks to implement atomic 64-bit operations on architectures without support for atomic 64-bit instructions. Unfortunately, the spinlocks are initialized in a pure initcall and that is too late for the vfs namespace code which wants to use atomic64 operations before the initcall is run. This became a problem as of commit 8823c079ba71: "vfs: Add setns support for the mount namespace". This leads to BUG messages such as: BUG: spinlock bad magic on CPU#0, swapper/0/0 lock: atomic64_lock+0x240/0x400, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 do_raw_spin_lock+0x158/0x198 _raw_spin_lock_irqsave+0x4c/0x58 atomic64_add_return+0x30/0x5c alloc_mnt_ns.clone.14+0x44/0xac create_mnt_ns+0xc/0x54 mnt_init+0x120/0x1d4 vfs_caches_init+0xe0/0x10c start_kernel+0x29c/0x300 coming out early on during boot when spinlock debugging is enabled. Fix this by initializing the spinlocks statically at compile time. Reported-and-tested-by: Vaibhav Bedia <vaibhav.bedia@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | MPI: Fix compilation on MIPS with GCC 4.4 and newerManuel Lauss2012-12-031-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit a3cea9894157c20a5b1ec08b7e0b5f2019740c10 upstream. Since 4.4 GCC on MIPS no longer recognizes the "h" constraint, leading to this build failure: CC lib/mpi/generic_mpih-mul1.o lib/mpi/generic_mpih-mul1.c: In function 'mpihelp_mul_1': lib/mpi/generic_mpih-mul1.c:50:3: error: impossible constraint in 'asm' This patch updates MPI with the latest umul_ppm implementations for MIPS. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Cc: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Cc: James Morris <jmorris@namei.org> Patchwork: https://patchwork.linux-mips.org/patch/4612/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Cc: Shuah Khan <shuah.khan@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | genalloc: stop crashing the system when destroying a poolThadeu Lima de Souza Cascardo2012-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit eedce141cd2dad8d0cefc5468ef41898949a7031 upstream. The genalloc code uses the bitmap API from include/linux/bitmap.h and lib/bitmap.c, which is based on long values. Both bitmap_set from lib/bitmap.c and bitmap_set_ll, which is the lockless version from genalloc.c, use BITMAP_LAST_WORD_MASK to set the first bits in a long in the bitmap. That one uses (1 << bits) - 1, 0b111, if you are setting the first three bits. This means that the API counts from the least significant bits (LSB from now on) to the MSB. The LSB in the first long is bit 0, then. The same works for the lookup functions. The genalloc code uses longs for the bitmap, as it should. In include/linux/genalloc.h, struct gen_pool_chunk has unsigned long bits[0] as its last member. When allocating the struct, genalloc should reserve enough space for the bitmap. This should be a proper number of longs that can fit the amount of bits in the bitmap. However, genalloc allocates an integer number of bytes that fit the amount of bits, but may not be an integer amount of longs. 9 bytes, for example, could be allocated for 70 bits. This is a problem in itself if the Least Significat Bit in a long is in the byte with the largest address, which happens in Big Endian machines. This means genalloc is not allocating the byte in which it will try to set or check for a bit. This may end up in memory corruption, where genalloc will try to set the bits it has not allocated. In fact, genalloc may not set these bits because it may find them already set, because they were not zeroed since they were not allocated. And that's what causes a BUG when gen_pool_destroy is called and check for any set bits. What really happens is that genalloc uses kmalloc_node with __GFP_ZERO on gen_pool_add_virt. With SLAB and SLUB, this means the whole slab will be cleared, not only the requested bytes. Since struct gen_pool_chunk has a size that is a multiple of 8, and slab sizes are multiples of 8, we get lucky and allocate and clear the right amount of bytes. Hower, this is not the case with SLOB or with older code that did memset after allocating instead of using __GFP_ZERO. So, a simple module as this (running 3.6.0), will cause a crash when rmmod'ed. [root@phantom-lp2 foo]# cat foo.c #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/genalloc.h> MODULE_LICENSE("GPL"); MODULE_VERSION("0.1"); static struct gen_pool *foo_pool; static __init int foo_init(void) { int ret; foo_pool = gen_pool_create(10, -1); if (!foo_pool) return -ENOMEM; ret = gen_pool_add(foo_pool, 0xa0000000, 32 << 10, -1); if (ret) { gen_pool_destroy(foo_pool); return ret; } return 0; } static __exit void foo_exit(void) { gen_pool_destroy(foo_pool); } module_init(foo_init); module_exit(foo_exit); [root@phantom-lp2 foo]# zcat /proc/config.gz | grep SLOB CONFIG_SLOB=y [root@phantom-lp2 foo]# insmod ./foo.ko [root@phantom-lp2 foo]# rmmod foo ------------[ cut here ]------------ kernel BUG at lib/genalloc.c:243! cpu 0x4: Vector: 700 (Program Check) at [c0000000bb0e7960] pc: c0000000003cb50c: .gen_pool_destroy+0xac/0x110 lr: c0000000003cb4fc: .gen_pool_destroy+0x9c/0x110 sp: c0000000bb0e7be0 msr: 8000000000029032 current = 0xc0000000bb0e0000 paca = 0xc000000006d30e00 softe: 0 irq_happened: 0x01 pid = 13044, comm = rmmod kernel BUG at lib/genalloc.c:243! [c0000000bb0e7ca0] d000000004b00020 .foo_exit+0x20/0x38 [foo] [c0000000bb0e7d20] c0000000000dff98 .SyS_delete_module+0x1a8/0x290 [c0000000bb0e7e30] c0000000000097d4 syscall_exit+0x0/0x94 --- Exception: c00 (System Call) at 000000800753d1a0 SP (fffd0b0e640) is in userspace Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Benjamin Gaignard <benjamin.gaignard@stericsson.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | lib/gcd.c: prevent possible div by 0Davidlohr Bueso2012-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e96875677fb2b7cb739c5d7769824dff7260d31d upstream. Account for all properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Fixes no known problems in current kernels. Signed-off-by: Davidlohr Bueso <dave@gnu.org> Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | digsig: add hash size comparision on signature verificationDmitry Kasatkin2012-10-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit bc01637a80f5b670bd70a0279d3f93fa8de1c96d upstream. When pkcs_1_v1_5_decode_emsa() returns without error and hash sizes do not match, hash comparision is not done and digsig_verify_rsa() returns no error. This is a bug and this patch fixes it. The bug was introduced in v3.3 by commit b35e286a640f ("lib/digsig: pkcs_1_v1_5_decode_emsa cleanup"). Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | bql: Avoid possible inconsistent calculation.Hiroaki SHIMODA2012-07-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 914bec1011a25f65cdc94988a6f974bfb9a3c10d ] dql->num_queued could change while processing dql_completed(). To provide consistent calculation, added an on stack variable. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Cc: Tom Herbert <therbert@google.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | bql: Avoid unneeded limit decrement.Hiroaki SHIMODA2012-07-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 25426b794efdc70dde7fd3134dc56fac3e7d562d ] When below pattern is observed, TIME dql_queued() dql_completed() | a) initial state | | b) X bytes queued V c) Y bytes queued d) X bytes completed e) Z bytes queued f) Y bytes completed a) dql->limit has already some value and there is no in-flight packet. b) X bytes queued. c) Y bytes queued and excess limit. d) X bytes completed and dql->prev_ovlimit is set and also dql->prev_num_queued is set Y. e) Z bytes queued. f) Y bytes completed. inprogress and prev_inprogress are true. At f), according to the comment, all_prev_completed becomes true and limit should be increased. But POSDIFF() ignores (completed == dql->prev_num_queued) case, so limit is decreased. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Cc: Tom Herbert <therbert@google.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Denys Fedoryshchenko <denys@visp.net.lb> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | bql: Fix POSDIFF() to integer overflow aware.Hiroaki SHIMODA2012-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 0cfd32b736ae0c36b42697584811042726c07cba ] POSDIFF() fails to take into account integer overflow case. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Cc: Tom Herbert <therbert@google.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Denys Fedoryshchenko <denys@visp.net.lb> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | btree: fix tree corruption in btree_get_prev()Roland Dreier2012-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit cbf8ae32f66a9ceb8907ad9e16663c2a29e48990 upstream. The memory the parameter __key points to is used as an iterator in btree_get_prev(), so if we save off a bkey() pointer in retry_key and then assign that to __key, we'll end up corrupting the btree internals when we do eg longcpy(__key, bkey(geo, node, i), geo->keylen); to return the key value. What we should do instead is use longcpy() to copy the key value that retry_key points to __key. This can cause a btree to get corrupted by seemingly read-only operations such as btree_for_each_safe. [akpm@linux-foundation.org: avoid the double longcpy()] Signed-off-by: Roland Dreier <roland@purestorage.com> Acked-by: Joern Engel <joern@logfs.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | radix-tree: fix contiguous iteratorKonstantin Khlebnikov2012-06-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit fffaee365fded09f9ebf2db19066065fa54323c3 upstream. This patch fixes bug in macro radix_tree_for_each_contig(). If radix_tree_next_slot() sees NULL in next slot it returns NULL, but following radix_tree_next_chunk() switches iterating into next chunk. As result iterating becomes non-contiguous and breaks vfs "splice" and all its users. Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Reported-and-bisected-by: Hans de Bruin <jmdebruin@xmsnet.nl> Reported-and-bisected-by: Ondrej Zary <linux@rainbow-software.org> Reported-bisected-and-tested-by: Toralf Förster <toralf.foerster@gmx.de> Link: https://lkml.org/lkml/2012/6/5/64 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | Implement wdog timer for do_exit()John Michelau2013-04-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If do_exit() doesn't finish within 30 seconds, then we assume that one of the task cleanup routines below is hopelessly stuck and we should crash to recover. This will catch cases where drivers are deadlocked in a file close path. Change-Id: I4dbdeb847ff318c25c0ebada9e821e444a2cb0d7 Signed-off-by: John Michelau <w14107@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/534742 SLT-Approved: Slta Waiver <sltawvr@motorola.com> Tested-by: Jira Key <jirakey@motorola.com> Reviewed-by: Check Patch <CHEKPACH@motorola.com> Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com> Reviewed-by: Christopher Fries <qcf001@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Submit-Approved: Jira Key <jirakey@motorola.com>
* | | Merge AU_LINUX_ANDROID_JB_2.5.04.02.01.40.134 (ES6+) to main-jb-qcpro-4.2Yinjun Chen2013-02-181-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/arm/configs/msm8960_defconfig arch/arm/mach-msm/board-8064-pmic.c arch/arm/mach-msm/board-8930-pmic.c arch/arm/mach-msm/board-8960-pmic.c arch/arm/mach-msm/rpm-regulator.c drivers/gpio/pm8xxx-gpio.c drivers/gpio/pm8xxx-mpp.c drivers/hwmon/pm8xxx-adc-scale.c drivers/media/video/msm/vfe/msm_vfe32.c drivers/misc/qseecom.c drivers/net/wireless/wcnss/wcnss_wlan.c drivers/power/Kconfig drivers/power/Makefile drivers/power/pm8921-bms.c drivers/power/pm8921-charger.c drivers/power/power_supply_sysfs.c drivers/regulator/pm8xxx-regulator.c drivers/tty/serial/msm_serial_hs.c drivers/video/msm/mdp4_overlay_dsi_cmd.c drivers/video/msm/mdp4_overlay_dsi_video.c drivers/video/msm/mdp4_util.c drivers/video/msm/mipi_dsi_host.c drivers/video/msm/msm_fb.c include/linux/mfd/pm8xxx/irq.h include/linux/mfd/pm8xxx/pm8921-bms.h include/linux/mfd/pm8xxx/pm8921-charger.h include/linux/power_supply.h include/media/msm_isp.h kernel/printk.c net/bluetooth/hidp/core.c sound/soc/msm/msm-dai-q6.c sound/soc/msm/msm8960.c
| * | Update copyright to The Linux FoundationDuy Truong2013-02-121-1/+1
| | | | | | | | | | | | | | | Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92 Signed-off-by: Duy Truong <dtruong@codeaurora.org>
* | | trace: allow tracing to use debugfs without enabling debugfs for everyoneJeffrey Carlyle2013-01-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a DebugFS-lite that can be selectively enabled via Makefiles. Change-Id: I33f021dd7267ce1b502734103513b87fa1b06621 Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/482346 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Check Patch <CHEKPACH@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/513904 Tested-by: Jira Key <jirakey@motorola.com> Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com> Submit-Approved: Jira Key <jirakey@motorola.com>
* | | kernel: softlockup: initiate watchdog reset when softlockup on IPI callYi-wei Zhao2013-01-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original softlockup logs for ipi call hang issue can't provide the backtrace on other CPUs. Since msm8960 can provide ramdump when watchdog bark, we can leverage it to find out the other cpu's backtrace by initiating a watchdog reset when this kind of softlockup occurs. This is ported from: * (CR) Trigger Watchdog when generic_exec_single() softlocup happens Reviewed-on: http://gerrit.pcs.mot.com/396617 Change-Id: Ia2cdb5def1e75b73f490d57b2758b228a50c6973 Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/510819 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com> Reviewed-by: Yuanyuan Zhong <a6510c@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
* | | Revert "(CR) kernel: softlockup: initiate watchdog reset when softlockup on ↵Yi-Wei Zhao2013-01-101-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPI call" This reverts commit 81497f9180b302c3e6f37e26479c5536e85a22ea Change-Id: I90c004c66cb61b4e046373ca2b98e9c25c4222db Reviewed-on: http://gerrit.pcs.mot.com/510515 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
* | | kernel: softlockup: initiate watchdog reset when softlockup on IPI callYi-wei Zhao2013-01-101-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original softlockup logs for ipi call hang issue can't provide the backtrace on other CPUs. Since msm8960 can provide ramdump when watchdog bark, we can leverage it to find out the other cpu's backtrace by initiating a watchdog reset when this kind of softlockup occurs. This is ported from: * (CR) Trigger Watchdog when generic_exec_single() softlocup happens Reviewed-on: http://gerrit.pcs.mot.com/396617 Change-Id: I581d6c46d266940669420d673f8fd884ed2778bf Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/509281 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Check Patch <CHEKPACH@motorola.com> Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com> Reviewed-by: Yuanyuan Zhong <a6510c@motorola.com>
* | | kernel: softlockup: add debugfs item for softlockup testYi-wei Zhao2012-12-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a kernel module to facilitate softlockup basic function test. This patch is ported from: * (CR) Add fire_softlockup_reset debugfs item. Reviewed-on: http://gerrit.pcs.mot.com/374616 Change-Id: I5fddf30ff247131d8192d4d65505e8ecaa2f8424 Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com> Reviewed-on: http://gerrit.pcs.mot.com/507278 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Tianshui Shi <kfp634@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
* | | dynamic_debug: init with early_initcall, not arch_initcallJim Cromie2012-12-061-2/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1- Call dynamic_debug_init() from early_initcall, not arch_initcall. 2- Call dynamic_debug_init_debugfs() from fs_initcall, not module_init. RFC: This works for me on a 64 bit desktop and a i586 SBC, but is untested on other arches. I presume there is or was a reason original code used arch_initcall, maybe the constraints have changed. This makes facility available as soon as possible. 2nd change has a downside when dynamic_debug.verbose=1; all the vpr_info()s called in the proc-fs code are activated, causing voluminous output from dmesg. TBD: Im unsure of this explanation, but the output is there. This could be fixed by changing those callsites to v2pr_info(if verbose > 1). 1st change is still not early enough to enable pr_debugs in kernel/params, so parsing of boot-args isnt logged. The reparse of those args is however visible after params.dyndbg="+p" is processed. Change-Id: If1d6c4e533fde3ee84e4c6d334a970e2f550635d Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Acked-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-on: http://gerrit.pcs.mot.com/502966 Tested-by: Jira Key <JIRAKEY@motorola.com> Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Reviewed-by: James Wylder <jwylder1@motorola.com>
* | lib: Pass the correct align offset to bitmap_find_next_zero_area_offLaura Abbott2012-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap_find_next_zero_area_off requires everything to be given in terms of bits. genpool no longer keeps track of everything in terms of bits so the start address must be shifted before passing to bitmap_find_next_zero_area_off. Without this, if the start address is unaligned, the code will not take this into account. Signed-off-by: Laura Abbott <lauraa@codeaurora.org> (cherry picked from commit e8e5365f74e311f5e0dd2513d3321d081355d308) Change-Id: I5eca13f181d50e6f9f8f39c7440c6619a8edc69a Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
* | lib: genalloc: Change chunk allocation to vmallocShubhraprakash Das2012-11-021-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the chunk allocation from kmalloc to vmalloc for allocations greater than a page. This allows large chunks to be allocated from physically non-contiguous memory and increases the chance of the allocation succeeding. CRs-fixed: 387655 Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org> (cherry picked from commit e461457b134e55c3ca68b91b70b8796e3f3dba69) Change-Id: I576fed3dd33fdfa9742f0c91bea72417c4f0086f Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
* | spinlock_debug: Print offset in addition to symbol nameStephen Boyd2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If one has two spinlocks embedded in a structure that kallsyms knows about and one of the spinlocks locks up we will print the name of the containing structure instead of the address of the lock. This is quite bad, so let's use %pS instead of %ps so we get an offset into the symbol so we can determine which lock is having problems. Change-Id: If6fbb2eb2316b846d96da76c35fcfeadbef64401 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* | spinlock_debug: Fix mismergeStephen Boyd2012-07-201-4/+0
| | | | | | | | | | | | | | | | This file was mismerged in the 3.4 kernel upgrade. We shouldn't print the lockup twice. Change-Id: If09a07d8b6c570632e1abac0a23c3ed203cd3ced Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
* | Merge commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126' into msm-3.4Steve Muckle2012-06-066-23/+464
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AU_LINUX_ANDROID_ICS.04.00.04.00.126 from msm-3.0. First parent is from google/android-3.4. * commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126': (8712 commits) PRNG: Device tree entry for qrng device. vidc:1080p: Set video core timeout value for Thumbnail mode msm: sps: improve the debugging support in SPS driver board-8064 msm: Overlap secure and non secure video firmware heaps. msm: clock: Add handoff ops for 7x30 and copper XO clocks msm_fb: display: Wait for external vsync before DTV IOMMU unmap msm: Fix ciruclar dependency in debug UART settings msm: gdsc: Add GDSC regulator driver for msm-copper defconfig: Enable Mobicore Driver. mobicore: Add mobicore driver. mobicore: rename variable to lower case. mobicore: rename folder. mobicore: add makefiles mobicore: initial import of kernel driver ASoC: msm: Add SLIMBUS_2_RX CPU DAI board-8064-gpio: Update FUNC for EPM SPI CS msm_fb: display: Remove chicken bit config during video playback mmc: msm_sdcc: enable the sanitize capability msm-fb: display: lm2 writeback support on mpq platfroms msm_fb: display: Disable LVDS phy & pll during panel off ... Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
| * | spinlock_debug: Print kallsyms name for lockStephen Boyd2012-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a spinlock warning is printed we usually get BUG: spinlock bad magic on CPU#0, modprobe/111 lock: 0xdff09f38, .magic: 00000000, .owner: /0, .owner_cpu: 0 but it's nicer to print the symbol for the lock if we have it so that we can avoid 'grep dff09f38 /proc/kallsyms' to find out which lock it was. Use kallsyms to print the symbol name so we get something a bit easier to read BUG: spinlock bad magic on CPU#0, modprobe/112 lock: test_lock, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 Change-Id: I833d011da8362960e97c53ebd59236ac7eb147fd Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
| * | vsprintf: Fix %ps on non symbols when using kallsymsStephen Boyd2012-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using %ps in a printk format will sometimes fail silently and print the empty string if the address passed in does not match a symbol that kallsyms knows about. But using %pS will fall back to printing the full address if kallsyms can't find the symbol. Make %ps act the same as %pS by falling back to printing the address. While we're here also make %ps print the module that a symbol comes from so that it matches what %pS already does. Take this simple function for example (in a module): static void test_printk(void) { int test; pr_info("with pS: %pS\n", &test); pr_info("with ps: %ps\n", &test); } Before this patch: with pS: 0xdff7df44 with ps: After this patch: with pS: 0xdff7df44 with ps: 0xdff7df44 Change-Id: Id03d74b079d40fe24b07a978909faedc741e281a Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
| * | Merge branch 'Linux 3.0.21' into msm-3.0Rohit Vaswani2012-03-302-1/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge Upstream's stable 3.0.21 branch into msm-3.0 This consists 814 commits and some merge conflicts. The merge conflicts are because of some local changes to msm-3.0 as well as some conflicts between google's tree and the upstream tree. Conflicts: arch/arm/kernel/head.S drivers/bluetooth/ath3k.c drivers/bluetooth/btusb.c drivers/mmc/core/core.c drivers/tty/serial/serial_core.c drivers/usb/host/ehci-hub.c drivers/usb/serial/qcserial.c fs/namespace.c fs/proc/base.c Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
| | * | netlink: validate NLA_MSECS lengthJohannes Berg2011-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c30bc94758ae2a38a5eb31767c1985c0aae0950b upstream. L2TP for example uses NLA_MSECS like this: policy: [L2TP_ATTR_RECV_TIMEOUT] = { .type = NLA_MSECS, }, code: if (info->attrs[L2TP_ATTR_RECV_TIMEOUT]) cfg.reorder_timeout = nla_get_msecs(info->attrs[L2TP_ATTR_RECV_TIMEOUT]); As nla_get_msecs() is essentially nla_get_u64() plus the conversion to a HZ-based value, this will not properly reject attributes from userspace that aren't long enough and might overrun the message. Add NLA_MSECS to the attribute minlen array to check the size properly. Cc: Thomas Graf <tgraf@suug.ch> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * | kobj_uevent: Ignore if some listeners cannot handle messageMilan Broz2011-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ebf4127cd677e9781b450e44dfaaa1cc595efcaa upstream. kobject_uevent() uses a multicast socket and should ignore if one of listeners cannot handle messages or nobody is listening at all. Easily reproducible when a process in system is cloned with CLONE_NEWNET flag. (See also http://article.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/5256) Signed-off-by: Milan Broz <mbroz@redhat.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | | fault_inject: Don't select frame pointer with ARM unwindLaura Abbott2011-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_FAULT_INJECTION_STACKTRACE_FILTER selects FRAME_POINTER. If ARM_UNWIND is used for backtracing, the FRAME_POINTER should not be selected. Change-Id: I94f31fb4b241976e408838e4b5a4138c58c395b0 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
| * | | Merge remote-tracking branch 'common/android-3.0' into msm-3.0Bryan Huntsman2011-11-163-8/+116
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/android-3.0: (570 commits) misc: remove kernel debugger core ARM: common: fiq_debugger: dump sysrq directly to console if enabled ARM: common: fiq_debugger: add irq context debug functions net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT net: wireless: bcmdhd: Call init_ioctl() only if was started properly net: wireless: bcmdhd: Fix possible memory leak in escan/iscan cpufreq: interactive governor: default 20ms timer cpufreq: interactive governor: go to intermediate hi speed before max cpufreq: interactive governor: scale to max only if at min speed cpufreq: interactive governor: apply intermediate load on current speed ARM: idle: update idle ticks before call idle end notifier input: gpio_input: don't print debounce message unless flag is set net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down net: wireless: bcmdhd: Improve suspend/resume processing net: wireless: bcmdhd: Check if FW is Ok for internal FW call tcp: Don't nuke connections for the wrong protocol ARM: common: fiq_debugger: make uart irq be no_suspend net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT mm: avoid livelock on !__GFP_FS allocations ... Conflicts: arch/arm/mm/cache-l2x0.c arch/arm/vfp/vfpmodule.c drivers/mmc/core/host.c kernel/power/wakelock.c net/bluetooth/hci_event.c Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
| | * | | Merge commit 'v3.0.8' into android-3.0Colin Cross2011-10-273-8/+116
| | |\| |
| | | * | XZ: Fix incorrect XZ_BUF_ERRORLasse Collin2011-10-031-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 9c1f8594df4814ebfd6822ca3c9444fb3445888d upstream. xz_dec_run() could incorrectly return XZ_BUF_ERROR if all of the following was true: - The caller knows how many bytes of output to expect and only provides that much output space. - When the last output bytes are decoded, the caller-provided input buffer ends right before the LZMA2 end of payload marker. So LZMA2 won't provide more output anymore, but it won't know it yet and thus won't return XZ_STREAM_END yet. - A BCJ filter is in use and it hasn't left any unfiltered bytes in the temp buffer. This can happen with any BCJ filter, but in practice it's more likely with filters other than the x86 BCJ. This fixes <https://bugzilla.redhat.com/show_bug.cgi?id=735408> where Squashfs thinks that a valid file system is corrupt. This also fixes a similar bug in single-call mode where the uncompressed size of a block using BCJ + LZMA2 was 0 bytes and caller provided no output space. Many empty .xz files don't contain any blocks and thus don't trigger this bug. This also tweaks a closely related detail: xz_dec_bcj_run() could call xz_dec_lzma2_run() to decode into temp buffer when it was known to be useless. This was harmless although it wasted a minuscule number of CPU cycles. Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | | * | crypto: Move md5_transform to lib/md5.cDavid S. Miller2011-08-152-1/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to use this for TCP/IP sequence number and fragment ID generation. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | | | kmemleak: Add support for memory hotplugLaura Abbott2011-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that memory hotplug can co-exist with kmemleak by taking the hotplug lock before scanning the memory banks. Change-Id: Ice6e5eaac45b4d71848ff1d3f30d468c1f088232 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
| * | | | lib: Add debugfs file for tracking memory allocationsJordan Crouse2011-10-031-4/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add caller information to memory allocation calls and create /sys/kernel/debug/mempool/map to show the current set of allocations across all memory pools. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
| * | | | Initial ContributionBryan Huntsman2011-10-035-82/+476
| |/ / / | | | | | | | | | | | | | | | | | | | | msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142 Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
| * | | Merge commit 'v3.0.1' into android-3.0Colin Cross2011-08-101-1/+1
| |\| |
| | * | XZ: Fix missing <linux/kernel.h> includeLasse Collin2011-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 81d67439855a7f928d90965d832aa4f2fb677342 upstream. <linux/kernel.h> is needed for min_t. The old version happened to work on x86 because <asm/unaligned.h> indirectly includes <linux/kernel.h>, but it didn't work on ARM. <linux/kernel.h> includes <asm/byteorder.h> so it's not necessary to include it explicitly anymore. Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | | Merge commit 'v3.0-rc7' into android-3.0Colin Cross2011-07-121-1/+1
| |\| |
| * | | plist: Remove the need to supply locks to plist headsDima Zavin2011-07-081-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was legacy code brought over from the RT tree and is no longer necessary. Signed-off-by: Dima Zavin <dima@android.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Daniel Walker <dwalker@codeaurora.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Link: http://lkml.kernel.org/r/1310084879-10351-2-git-send-email-dima@android.com Signed-off-by: Ingo Molnar <mingo@elte.hu>