1. 20 Aug, 2008 14 commits
    • Mike Frysinger's avatar
      Blackfin RTC Driver: move irq request/free out of open/release and into... · fe2e1cf8
      Mike Frysinger authored
      Blackfin RTC Driver: move irq request/free out of open/release and into probe/remove so that the non-dev interfaces (like sysfs) work as expected
      Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
      Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fe2e1cf8
    • Clement Calmels's avatar
      /proc/self/maps doesn't display the real file offset · 1804dc6e
      Clement Calmels authored
      This addresses
      
      	http://bugzilla.kernel.org/show_bug.cgi?id=11318
      
      In function show_map (file: fs/proc/task_mmu.c), if vma->vm_pgoff > 2^20
      than (vma->vm_pgoff << PAGE_SIZE) is greater than 2^32 (with PAGE_SIZE
      equal to 4096 (i.e.  2^12).  The next seq_printf use an unsigned long for
      the conversion of (vma->vm_pgoff << PAGE_SIZE), as a result the offset
      value displayed in /proc/self/maps is truncated if the page offset is
      greater than 2^20.
      
      A test that shows this issue:
      
      #define _GNU_SOURCE
      #include <sys/types.h>
      #include <sys/stat.h>
      #include <sys/mman.h>
      #include <stdlib.h>
      #include <stdio.h>
      #include <fcntl.h>
      #include <unistd.h>
      #include <string.h>
      
      #define PAGE_SIZE (getpagesize())
      
      #if __i386__
      #   define U64_STR "%llx"
      #elif __x86_64
      #   define U64_STR "%lx"
      #else
      #   error "Architecture Unsupported"
      #endif
      
      int main(int argc, char *argv[])
      {
      	int fd;
      	char *addr;
      	off64_t offset = 0x10000000;
      	char *filename = "/dev/zero";
      
      	fd = open(filename, O_RDONLY);
      	if (fd < 0) {
      		perror("open");
      		return 1;
      	}
      
      	offset *= 0x10;
      	printf("offset = " U64_STR "\n", offset);
      
      	addr = (char*)mmap64(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd,
      			     offset);
      	if ((void*)addr == MAP_FAILED) {
      		perror("mmap64");
      		return 1;
      	}
      
      	{
      		FILE *fmaps;
      		char *line = NULL;
      		size_t len = 0;
      		ssize_t read;
      		size_t filename_len = strlen(filename);
      
      		fmaps = fopen("/proc/self/maps", "r");
      		if (!fmaps) {
      			perror("fopen");
      			return 1;
      		}
      		while ((read = getline(&line, &len, fmaps)) != -1) {
      			if ((read > filename_len + 1)
      			    && (strncmp(&line[read - filename_len - 1], filename, filename_len) == 0))
      				printf("%s", line);
      		}
      
      		if (line)
      			free(line);
      
      		fclose(fmaps);
      	}
      
      	close(fd);
      	return 0;
      }
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarClement Calmels <cboulte@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1804dc6e
    • Andreas Herrmann's avatar
      documentation: describe bootmem_debug kernel parameter · 35fc908d
      Andreas Herrmann authored
      "bootmem_debug" is not mentioned in kernel-parameters.txt. Recently I
      had to use that kernel option and I think it should be documented.
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Johannes Weiner <hannes@saeurebad.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      35fc908d
    • Matthew Garrett's avatar
      eeepc-laptop: fix use after free · f1441318
      Matthew Garrett authored
      eeepc-laptop uses the hwmon struct after unregistering the device, causing
      an oops on module unload.  Flip the ordering to fix.
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Karol Kozimor <sziwan@users.sourceforge.net>
      Cc: <stable@kernel.org>		[2.6.26.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f1441318
    • David Howells's avatar
      FRV: Provide ioremap_wc() for FRV · 0c7281c0
      David Howells authored
      Provide ioremap_wc() for FRV.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0c7281c0
    • David Howells's avatar
      MN10300: Supply ioremap_wc() for MN10300 · 449f7650
      David Howells authored
      Supply ioremap_wc() for MN10300.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      449f7650
    • David Woodhouse's avatar
      Reserve NFS fileid values for btrfs · e4464fac
      David Woodhouse authored
      Purely cosmetic for now, but we might as well get it merged ASAP.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e4464fac
    • David Woodhouse's avatar
      Reduce brokenness of CRIS headers_install · 1c8e40e4
      David Woodhouse authored
      I won't say 'fix', because they still look broken, although this will at
      least allow 'make ARCH=CRIS headers_install' to _complete_.
      
      For headers which are exported, we should probably choose between
      asm/arch-v10 and asm/arch-v32 by something that GCC defines -- we can't
      rely on a generated symlink. And we certainly can't export an arch/
      directory which doesn't even exist.
      
      And the only thing that we seem to include from the arch/ directory is
      <asm/arch/ptrace.h> from <asm/ptrace.h> ... and that isn't exported in
      either arch-v10 or arch-v32 _anyway_.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c8e40e4
    • Linus Torvalds's avatar
      Merge branch 'sh/for-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · 1bbe44f6
      Linus Torvalds authored
      * 'sh/for-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
        sh: Provide a FLAT_PLAT_INIT() definition.
        binfmt_flat: Stub in a FLAT_PLAT_INIT().
        video: export sh_mobile_lcdc panel size
        sh: select memchunk size using kernel cmdline
        sh: export sh7723 VEU as VEU2H
        input: migor_ts compile and detection fix
        sh: remove MSTPCR defines from Migo-R header file
        sh: Update sh7763rdp defconfig
        sh: Add support sh7760fb to sh7763rdp board
        sh: Add support sh_eth to sh7763rdp board
        sh: Disable 64kB hugetlbpage size when using 64kB PAGE_SIZE.
        sh: Don't export __{s,u}divsi3_i4i from SH-2 libgcc.
        fix SH7705_CACHE_32KB compilation
        sh: mach-x3proto: Fix up smc91x platform data.
      1bbe44f6
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc · 8498ffd6
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
        powerpc: Fix vio_bus_probe oops on probe error
        powerpc/ibmebus: Restore "name" sysfs attribute on ibmebus devices
        powerpc: Fix /dev/oldmem interface for kdump
        powerpc/spufs: Remove invalid semicolon after if statement
        powerpc/spufs: reference context while dropping state mutex in scheduler
        powerpc/spufs: fix npc setting for NOSCHED contexts
      8498ffd6
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 · c5b0079c
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (22 commits)
        [SCSI] ibmvfc: Driver version 1.0.2
        [SCSI] ibmvfc: Add details to async event log
        [SCSI] ibmvfc: Sanitize response lengths
        [SCSI] ibmvfc: Fix for lost async events
        [SCSI] ibmvfc: Fixup host state during reinit
        [SCSI] ibmvfc: Fix another hang on module removal
        [SCSI] ibmvscsi: Fixup desired DMA value for shared memory partitions
        [SCSI] megaraid_sas: remove sysfs dbg_lvl world writeable permissions
        [SCSI] qla2xxx: Update version number to 8.02.01-k7.
        [SCSI] qla2xxx: Explicitly tear-down vports during PCI remove_one().
        [SCSI] qla2xxx: Reference proper ha during SBR handling.
        [SCSI] qla2xxx: Set npiv_supported flag for FCoE HBAs.
        [SCSI] qla2xxx: Don't leak SG-DMA mappings while aborting commands.
        [SCSI] qla2xxx: Correct vport-state management issues during ISP-ABORT.
        [SCSI] qla2xxx: Correct synchronization of software/firmware fcport states.
        [SCSI] scsi_dh: Initialize lun_state in check_ownership()
        [SCSI] scsi_dh: Do not use scsilun in rdac hardware handler
        [SCSI] megaraid_sas: version and Documentation Update
        [SCSI] megaraid_sas: add new controllers (0x78 0x79)
        [SCSI] megaraid_sas: add the shutdown DCMD cmd to driver shutdown routine
        ...
      c5b0079c
    • Linus Torvalds's avatar
      vfat: fix 'sync' mount deadlock due to BKL->lock_super conversion · 5f22ca9b
      Linus Torvalds authored
      There was another FAT BKL conversion deadlock reported by Bart
      Trojanowski due to the BKL being used as a recursive lock by FAT, which
      was missed because it only triggers with 'sync' (or 'dirsync') mounts.
      
      The recursion worked for the BKL, but after the conversion to lock_super
      (which uses a mutex), it just deadlocks.
      
      Thanks to Bart for debugging this and testing the fix.  The lock
      debugging information from the original report:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        2.6.27-rc3-bisect-00448-ga7f5aaf3 #16
        ---------------------------------------------
        mv/4020 is trying to acquire lock:
         (&type->s_lock_key#9){--..}, at: [<c01a90fe>] lock_super+0x1e/0x20
      
        but task is already holding lock:
         (&type->s_lock_key#9){--..}, at: [<c01a90fe>] lock_super+0x1e/0x20
      
        other info that might help us debug this:
        3 locks held by mv/4020:
         #0:  (&sb->s_type->i_mutex_key#9/1){--..}, at: [<c01b2336>] do_unlinkat+0x66/0x140
         #1:  (&sb->s_type->i_mutex_key#9){--..}, at: [<c01b0954>] vfs_unlink+0x84/0x110
         #2:  (&type->s_lock_key#9){--..}, at: [<c01a90fe>] lock_super+0x1e/0x20
      
        stack backtrace:
        Pid: 4020, comm: mv Not tainted 2.6.27-rc3-bisect-00448-ga7f5aaf3 #16
         [<c014e694>] validate_chain+0x984/0xea0
         [<c0108d70>] ? native_sched_clock+0x0/0xf0
         [<c014ee9c>] __lock_acquire+0x2ec/0x9b0
         [<c014f5cf>] lock_acquire+0x6f/0x90
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c044e5fd>] mutex_lock_nested+0xad/0x300
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c01a90fe>] lock_super+0x1e/0x20
         [<f8b3a700>] fat_write_inode+0x60/0x2b0 [fat]
         [<c0450878>] ? _spin_unlock_irqrestore+0x48/0x80
         [<f8b3a953>] ? fat_sync_inode+0x3/0x20 [fat]
         [<f8b3a962>] fat_sync_inode+0x12/0x20 [fat]
         [<f8b37c7e>] fat_remove_entries+0xbe/0x120 [fat]
         [<f8b422ef>] vfat_unlink+0x5f/0x90 [vfat]
         [<f8b42290>] ? vfat_unlink+0x0/0x90 [vfat]
         [<c01b0968>] vfs_unlink+0x98/0x110
         [<c01b2400>] do_unlinkat+0x130/0x140
         [<c016a8f5>] ? audit_syscall_entry+0x105/0x150
         [<c01b253b>] sys_unlinkat+0x3b/0x40
         [<c01040d3>] sysenter_do_call+0x12/0x3f
         =======================
      
      where the deadlock is due to the nesting of lock_super from vfat_unlink
      to fat_write_inode:
      
       - do_unlinkat
         - vfs_unlink
           - vfat_unlink
             * lock_super
             - fat_remove_entries
               - fat_sync_inode
                 - fat_write_inode
                   * lock_super
      
      and the fix is to simply remove the use of lock_super() in fat_write_inode.
      
      The lock_super() there had been just an automatic conversion of the
      kernel lock to the superblock lock, but no locking was actually needed
      there, since the code in fat_write_inode already protected all relevant
      accesses with a spinlock (sbi->inode_hash_lock to be exact).  The only
      code inside the BKL (and thus the superblock lock) was accesses tp local
      variables or calls to functions that have long been SMP-safe (i.e.
      sb_bread, mark_buffe_dirty and brlese).
      
      Bart reports:
       "Looks good.  I ran 10 parallel processes creating 1M files truncating
        them, writing to them again and then deleting them.  This patch fixes
        the issue I ran into.
      
        Signed-off-by: Bart Trojanowski <bart@jukie.net>"
      Reported-and-tested-by: default avatarBart Trojanowski <bart@jukie.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5f22ca9b
    • Roland McGrath's avatar
      tracehook: fix SA_NOCLDWAIT · 1b04624f
      Roland McGrath authored
      I outwitted myself again in commit 2b2a1ff6,
      and broke the SA_NOCLDWAIT behavior so it leaks zombies.  This fixes it.
      Reported-by: default avatarAndi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      1b04624f
  2. 19 Aug, 2008 26 commits