1. 15 Jul, 2010 8 commits
    • Bob Peterson's avatar
      GFS2: rename causes kernel Oops · 728a756b
      Bob Peterson authored
      This patch fixes a kernel Oops in the GFS2 rename code.
      
      The problem was in the way the gfs2 directory code was trying
      to re-use sentinel directory entries.
      
      In the failing case, gfs2's rename function was renaming a
      file to another name that had the same non-trivial length.
      The file being renamed happened to be the first directory
      entry on the leaf block.
      
      First, the rename code (gfs2_rename in ops_inode.c) found the
      original directory entry and decided it could do its job by
      simply replacing the directory entry with another.  Therefore
      it determined correctly that no block allocations were needed.
      
      Next, the rename code deleted the old directory entry prior to
      replacing it with the new name.  Therefore, the soon-to-be
      replaced directory entry was temporarily made into a directory
      entry "sentinel" or a place holder at the start of a leaf block.
      
      Lastly, it went to re-add the replacement directory entry in
      that leaf block.  However, when gfs2_dirent_find_space was
      looking for space in the leaf block, it used the wrong value
      for the sentinel.  That threw off its calculations so later
      it decides it can't really re-use the sentinel and therefore
      must allocate a new leaf block.  But because it previously decided
      to re-use the directory entry, it didn't waste the time to
      grab a new block allocation for the inode.  Therefore, the
      inode's i_alloc pointer was still NULL and it crashes trying to
      reference it.
      
      In the case of sentinel directory entries, the entire dirent is
      reused, not just the "free space" portion of it, and therefore
      the function gfs2_dirent_find_space should use the value 0
      rather than GFS2_DIRENT_SIZE(0) for the actual dirent size.
      
      Fixing this calculation enables the reproducer programs to work
      properly.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      728a756b
    • Abhijith Das's avatar
      GFS2: BUG in gfs2_adjust_quota · 8b421601
      Abhijith Das authored
      HighMem pages on i686 do not get mapped to the buffer_heads and this was
      causing a NULL pointer dereference when we were trying to memset page buffers
      to zero.
      We now use zero_user() that kmaps the page and directly manipulates page data.
      This patch also fixes a boundary condition that was incorrect.
      Signed-off-by: default avatarAbhi Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      8b421601
    • Bob Peterson's avatar
      GFS2: Fix kernel NULL pointer dereference by dlm_astd · b1becbde
      Bob Peterson authored
      This patch fixes a problem in an error path when looking
      up dinodes.  There are two sister-functions, gfs2_inode_lookup
      and gfs2_process_unlinked_inode.  Both functions acquire and
      hold the i_iopen glock for the dinode being looked up. The last
      thing they try to do is hold the i_gl glock for the dinode.
      If that glock fails for some reason, the error path was
      incorrectly calling gfs2_glock_put for the i_iopen glock twice.
      This resulted in the glock being prematurely freed.  The
      "minimum hold time" usually kept the glock in memory, but the
      lock interface to dlm (aka lock_dlm) freed its memory for the
      glock.  In some circumstances, it would cause dlm's dlm_astd daemon
      to try to call the bast function for the freed lock_dlm memory,
      which resulted in a NULL pointer dereference.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      b1becbde
    • Bob Peterson's avatar
      GFS2: recovery stuck on transaction lock · b7dc2df5
      Bob Peterson authored
      This patch fixes bugzilla bug #590878: GFS2: recovery stuck on
      transaction lock.  We set the frozen flag on the glock when we receive
      a completion that cannot be delivered due to blocked locks. At that
      point we check to see whether the first waiting holder has the noexp
      flag set. If the noexp lock is queued later, then we need to unfreeze
      the glock at that point in time, namely, in the glock work function.
      
      This patch was originally written by Steve Whitehouse, but since
      he's on holiday, I'm submitting it.  It's been well tested with a
      complex recovery test called revolver.
      Signed-off-by: default avatarSteve Whitehouse <swhiteho@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      b7dc2df5
    • Bob Peterson's avatar
      GFS2: O_TRUNC not working on stuffed files across cluster · a8bf2bc2
      Bob Peterson authored
      This patch replaces a statement that got dropped out by accident.
      Without the patch, truncates on stuffed (very small) files cause
      those files to have an unpredictable size.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      a8bf2bc2
    • Linus Torvalds's avatar
      Merge master.kernel.org:/home/rmk/linux-2.6-arm · 2f7989ef
      Linus Torvalds authored
      * master.kernel.org:/home/rmk/linux-2.6-arm:
        ARM: 6226/1: fix kprobe bug in ldr instruction emulation
        ARM: Update mach-types
        ARM: lockdep: fix unannotated irqs-on
        ARM: 6184/2: ux500: use neutral PRCMU base
        ARM: 6212/1: atomic ops: add memory constraints to inline asm
        ARM: 6211/1: atomic ops: fix register constraints for atomic64_add_unless
        ARM: 6210/1: Do not rely on reset defaults of L2X0_AUX_CTRL
      2f7989ef
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · ea4c1a7e
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/fsl-booke: Fix address issue when using relocatable kernels
        powerpc/cpm1: Mark micropatch code/data static and __init
        powerpc/cpm1: Fix build with various CONFIG_*_UCODE_PATCH combinations
        powerpc/cpm: Reintroduce global spi_pram struct (fixes build issue)
      ea4c1a7e
  2. 14 Jul, 2010 4 commits
  3. 12 Jul, 2010 8 commits
  4. 11 Jul, 2010 10 commits
  5. 10 Jul, 2010 3 commits
    • Russell King's avatar
      ARM: lockdep: fix unannotated irqs-on · ac78884e
      Russell King authored
      CPU: Testing write buffer coherency: ok
      ------------[ cut here ]------------
      WARNING: at kernel/lockdep.c:3145 check_flags+0xcc/0x1dc()
      Modules linked in:
      [<c0035120>] (unwind_backtrace+0x0/0xf8) from [<c0355374>] (dump_stack+0x20/0x24)
      [<c0355374>] (dump_stack+0x20/0x24) from [<c0060c04>] (warn_slowpath_common+0x58/0x70)
      [<c0060c04>] (warn_slowpath_common+0x58/0x70) from [<c0060c3c>] (warn_slowpath_null+0x20/0x24)
      [<c0060c3c>] (warn_slowpath_null+0x20/0x24) from [<c008f224>] (check_flags+0xcc/0x1dc)
      [<c008f224>] (check_flags+0xcc/0x1dc) from [<c00945dc>] (lock_acquire+0x50/0x140)
      [<c00945dc>] (lock_acquire+0x50/0x140) from [<c0358434>] (_raw_spin_lock+0x50/0x88)
      [<c0358434>] (_raw_spin_lock+0x50/0x88) from [<c00fd114>] (set_task_comm+0x2c/0x60)
      [<c00fd114>] (set_task_comm+0x2c/0x60) from [<c007e184>] (kthreadd+0x30/0x108)
      [<c007e184>] (kthreadd+0x30/0x108) from [<c0030104>] (kernel_thread_exit+0x0/0x8)
      ---[ end trace 1b75b31a2719ed1c ]---
      possible reason: unannotated irqs-on.
      irq event stamp: 3
      hardirqs last  enabled at (2): [<c0059bb0>] finish_task_switch+0x48/0xb0
      hardirqs last disabled at (3): [<c002f0b0>] ret_slow_syscall+0xc/0x1c
      softirqs last  enabled at (0): [<c005f3e0>] copy_process+0x394/0xe5c
      softirqs last disabled at (0): [<(null)>] (null)
      
      Fix this by ensuring that the lockdep interrupt state is manipulated in
      the appropriate places.  We essentially treat userspace as an entirely
      separate environment which isn't relevant to lockdep (lockdep doesn't
      monitor userspace.)  We don't tell lockdep that IRQs will be enabled
      in that environment.
      
      Instead, when creating kernel threads (which is a rare event compared
      to entering/leaving userspace) we have to update the lockdep state.  Do
      this by starting threads with IRQs disabled, and in the kthread helper,
      tell lockdep that IRQs are enabled, and enable them.
      
      This provides lockdep with a consistent view of the current IRQ state
      in kernel space.
      
      This also revert portions of 0d928b0b
      which didn't fix the problem.
      Tested-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ac78884e
    • Guenter Roeck's avatar
      i2c/mips: Fix error return codes from Sibyte i2c bus driver · 102b59c6
      Guenter Roeck authored
      Sibyte i2c bus driver returns non-descriptive error values.
      Update to return error values as defined in Documentation/i2c/fault-codes.
      Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      102b59c6
    • Jean Delvare's avatar
      i2c: Fix probability check · 827900c5
      Jean Delvare authored
      The new unified probing function differs from the original code, and
      the preliminary test whether probing is possible must be updated
      accordingly.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      827900c5
  6. 09 Jul, 2010 7 commits
    • Jean Delvare's avatar
      hwmon: Fix autoloading of fschmd on recent Fujitsu machines · faabd47f
      Jean Delvare authored
      Fujitsu slightly changed the DMI strings in their recent machines,
      (for example the D2778) and this breaks the automatic loading of the
      needed fschmd driver. Being more tolerant on string comparison fixes
      the issue.
      
      This closes bug #15634:
      https://bugzilla.kernel.org/show_bug.cgi?id=15634Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Tested-by: default avatarSergey Spiridonov <sena@hurd.homeunix.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      faabd47f
    • Jean Delvare's avatar
      hwmon: (coretemp) Properly label the sensors · 3f4f09b4
      Jean Delvare authored
      Don't assume that CPU entry number and core ID always match. It
      worked in the simple cases (single CPU, no HT) but fails on
      multi-CPU systems.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Acked-by: default avatarHuaxu Wan <huaxu.wan@intel.com>
      Cc: stable@kernel.org
      3f4f09b4
    • Jean Delvare's avatar
      hwmon: (coretemp) Skip duplicate CPU entries · d883b9f0
      Jean Delvare authored
      On hyper-threaded CPUs, each core appears twice in the CPU list. Skip
      the second entry to avoid duplicate sensors.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Acked-by: default avatarHuaxu Wan <huaxu.wan@intel.com>
      Cc: stable@kernel.org
      d883b9f0
    • Jean Delvare's avatar
      hwmon: (it87) Fix in7 on IT8720F · 436cad2a
      Jean Delvare authored
      The IT8720F has no VIN7 pin, so VCCH should always be routed
      internally to VIN7 with an internal divider. Curiously, there still
      is a configuration bit to control this, which means it can be set
      incorrectly. And even more curiously, many boards out there are
      improperly configured, even though the IT8720F datasheet claims that
      the internal routing of VCCH to VIN7 is the default setting. So we
      force the internal routing in this case.
      
      It turns out that all boards with the wrong setting are from Gigabyte,
      so I suspect a BIOS bug. But it's easy enough to workaround in the
      driver, so let's do it.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Jean-Marc Spaggiari <jean-marc@spaggiari.org>
      Cc: stable@kernel.org
      436cad2a
    • Andreas Herrmann's avatar
      hwmon: (k8temp) Fix temperature reporting for ASB1 processor revisions · d535bad9
      Andreas Herrmann authored
      Reported temperature for ASB1 CPUs is too high.
      Add ASB1 CPU revisions (these are also non-desktop variants) to the
      list of CPUs for which the temperature fixup is not required.
      
      Example: (from LENOVO ThinkPad Edge 13, 01972NG, system was idle)
      
        Current kernel reports
      
        $ sensors
        k8temp-pci-00c3
        Adapter: PCI adapter
        Core0 Temp:  +74.0 C
        Core0 Temp:  +70.0 C
        Core1 Temp:  +69.0 C
        Core1 Temp:  +70.0 C
      
        With this patch I have
      
        $ sensors
        k8temp-pci-00c3
        Adapter: PCI adapter
        Core0 Temp:  +54.0 C
        Core0 Temp:  +51.0 C
        Core1 Temp:  +48.0 C
        Core1 Temp:  +49.0 C
      
      Cc: stable@kernel.org [.32.x .33.x, .34.x]
      Cc: Rudolf Marek <r.marek@assembler.cz>
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      d535bad9
    • Linus Walleij's avatar
      ARM: 6184/2: ux500: use neutral PRCMU base · d9e38040
      Linus Walleij authored
      The MTU wallclock timing fix-up patch was hardwired to the DB8500
      causing a regression. This makes it work on the DB5500 as well.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      d9e38040
    • Will Deacon's avatar
      ARM: 6212/1: atomic ops: add memory constraints to inline asm · 398aa668
      Will Deacon authored
      Currently, the 32-bit and 64-bit atomic operations on ARM do not
      include memory constraints in the inline assembly blocks. In the
      case of barrier-less operations [for example, atomic_add], this
      means that the compiler may constant fold values which have actually
      been modified by a call to an atomic operation.
      
      This issue can be observed in the atomic64_test routine in
      <kernel root>/lib/atomic64_test.c:
      
      00000000 <test_atomic64>:
         0:	e1a0c00d 	mov	ip, sp
         4:	e92dd830 	push	{r4, r5, fp, ip, lr, pc}
         8:	e24cb004 	sub	fp, ip, #4
         c:	e24dd008 	sub	sp, sp, #8
        10:	e24b3014 	sub	r3, fp, #20
        14:	e30d000d 	movw	r0, #53261	; 0xd00d
        18:	e3011337 	movw	r1, #4919	; 0x1337
        1c:	e34c0001 	movt	r0, #49153	; 0xc001
        20:	e34a1aa3 	movt	r1, #43683	; 0xaaa3
        24:	e16300f8 	strd	r0, [r3, #-8]!
        28:	e30c0afe 	movw	r0, #51966	; 0xcafe
        2c:	e30b1eef 	movw	r1, #48879	; 0xbeef
        30:	e34d0eaf 	movt	r0, #57007	; 0xdeaf
        34:	e34d1ead 	movt	r1, #57005	; 0xdead
        38:	e1b34f9f 	ldrexd	r4, [r3]
        3c:	e1a34f90 	strexd	r4, r0, [r3]
        40:	e3340000 	teq	r4, #0
        44:	1afffffb 	bne	38 <test_atomic64+0x38>
        48:	e59f0004 	ldr	r0, [pc, #4]	; 54 <test_atomic64+0x54>
        4c:	e3a0101e 	mov	r1, #30
        50:	ebfffffe 	bl	0 <__bug>
        54:	00000000 	.word	0x00000000
      
      The atomic64_set (0x38-0x44) writes to the atomic64_t, but the
      compiler doesn't see this, assumes the test condition is always
      false and generates an unconditional branch to __bug. The rest of the
      test is optimised away.
      
      This patch adds suitable memory constraints to the atomic operations on ARM
      to ensure that the compiler is informed of the correct data hazards. We have
      to use the "Qo" constraints to avoid hitting the GCC anomaly described at
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44492 , where the compiler
      makes assumptions about the writeback in the addressing mode used by the
      inline assembly. These constraints forbid the use of auto{inc,dec} addressing
      modes, so it doesn't matter if we don't use the operand exactly once.
      
      Cc: stable@kernel.org
      Reviewed-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      398aa668