1. 23 6月, 2006 40 次提交
    • K
      [PATCH] WAN: ioremap() failure checks in drivers · 4446065a
      Krzysztof Halasa 提交于
      Eric Sesterhenn found that pci200syn initialization lacks return
      statement in ioremap() error path (coverity bug id #195). It looks
      like more WAN drivers have problems with ioremap().
      Signed-off-by: NKrzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4446065a
    • K
      [PATCH] WAN: register_hdlc_device() doesn't need dev_alloc_name() · 4a31e348
      Krzysztof Halasa 提交于
      David Boggs noticed that register_hdlc_device() no longer needs
      to call dev_alloc_name() as it's called by register_netdev().
      register_hdlc_device() is currently equivalent to register_netdev().
      
      hdlc_setup() is now EXPORTed as per David's request.
      Signed-off-by: NKrzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4a31e348
    • A
      [PATCH] skb_padto()-area fixes in 8390, wavelan · aa95abef
      Alan Cox 提交于
      Ar Iau, 2006-06-22 am 21:29 +1000, ysgrifennodd Herbert Xu:
      > Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
      > >
      > > The 8390 change (corrected version) also makes 8390.c faster so should
      > > be applied anyway, and the orinoco one fixes some code that isn't even
      > > needed and someone forgot to remove long ago. Otherwise the skb_padto
      >
      > Yeah I agree totally.  However, I haven't actually seen the fixed 8390
      > version being posted yet or at least not to netdev :)
      
      Ah the resounding clang of a subtle hint ;)
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      - Return 8390.c to the old way of handling short packets (which is also
      faster)
      
      - Remove the skb_padto from orinoco. This got left in when the padding bad
      write patch was added and is actually not needed. This is fixing a merge
      error way back when.
      
      - Wavelan can also use the stack based buffer trick if you want
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      aa95abef
    • A
      [PATCH] make drivers/net/forcedeth.c:nv_update_pause() static · c7985051
      Adrian Bunk 提交于
      This patch makes the needlessly global nv_update_pause() static.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c7985051
    • S
      [PATCH] network driver for Hilscher netx · 92aa674d
      Sascha Hauer 提交于
      This is a patch for the Hilscher netx builtin ethernet ports. The
      netx board support was merged into 2.6.17-git2.
      The netx is a arm926 based SoC.
      Signed-off-by: NRobert Schwebel <r.schwebel@pengutronix.de>
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      
      --
       drivers/net/Kconfig             |   11
       drivers/net/Makefile            |    1
       drivers/net/netx-eth.c          |  516 ++++++++++++++++++++++++++++++++++++++++
       include/asm-arm/arch-netx/eth.h |   27 ++
       4 files changed, 555 insertions(+)
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      92aa674d
    • E
      [PATCH] Dereference in tokenring/olympic.c · 6d56ab93
      Eric Sesterhenn 提交于
      hi,
      
      coverity found (bug id #225) that we might call free_netdev()
      with NULL argument, when alloc_trdev() fails. This patch
      changes the goto, so we dont call free_netdev() for
      dev == NULL.
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6d56ab93
    • E
      [PATCH] Array overrun in drivers/net/wireless/wavelan.c · a192491a
      Eric Sesterhenn 提交于
      hi,
      
      this is another array overrun spotted by coverity (#id 507)
      we should check the index against array size before using it.
      Not sure why the driver doesnt use ARRAY_SIZE instead of its
      own macro.
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a192491a
    • E
      [PATCH] Remove useless check in drivers/net/pcmcia/xirc2ps_cs.c · da4f5ccf
      Eric Sesterhenn 提交于
      hi,
      
      coverity choked at this check (id #223), assuming that
      skb might be NULL and used anyways later. Since
      start_hard_xmit() always gets called with a valid
      skb, the check is useless and this patch removes it.
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      da4f5ccf
    • P
      [PATCH] 8139cp: add ethtool eeprom support · 722fdb33
      Philip Craig 提交于
      Implement the ethtool eeprom operations for the 8139cp driver.
      Tested on x86 and big-endian ARM.
      Signed-off-by: NPhilip Craig <philipc@snapgear.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      722fdb33
    • P
      [PATCH] 8139cp: fix eeprom read command length · d73f1e3c
      Philip Craig 提交于
      The read command for the 93C46/93C56 EEPROMS should be 3 bits plus
      the address.  This doesn't appear to affect the operation of the
      read command, but similar errors for write commands do cause failures.
      Signed-off-by: NPhilip Craig <philipc@snapgear.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d73f1e3c
    • G
      [PATCH] b44: update b44 Kconfig entry · fc13dcae
      Gary Zambrano 提交于
      Deleted "EXPERIMENTAL" from b44 entry in Kconfig.
      Signed-off-by: NGary Zambrano <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fc13dcae
    • G
      [PATCH] b44: update version to 1.01 · 4d1dabdb
      Gary Zambrano 提交于
      Update the driver version to 1.01
      Signed-off-by: NGary Zambrano <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4d1dabdb
    • G
      [PATCH] b44: add wol for old nic · 725ad800
      Gary Zambrano 提交于
      This patch adds wol support for the older 440x nics that use pattern matching.
      This patch is a redo thanks to feedback from Michael Chan and Francois Romieu.
      Signed-off-by: NGary Zambrano  <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      725ad800
    • G
      [PATCH] b44: add parameter · 00e8b3aa
      Gary Zambrano 提交于
      This patch adds a parameter to init_hw() to not completely initialize
      the nic for wol.
      Signed-off-by: NGary Zambrano <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      00e8b3aa
    • G
      [PATCH] b44: add wol · 52cafd96
      Gary Zambrano 提交于
      Adds wol to the driver.
      This is a redo of a previous patch thanks to feedback from Francois Romieu.
      
      Signed-off-by Gary Zambrano <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      52cafd96
    • G
      [PATCH] b44: fix manual speed/duplex/autoneg settings · 47b9c3b1
      Gary Zambrano 提交于
      Fixes for speed/duplex/autoneg settings and driver settings info.
      This is a redo of a previous patch thanks to feedback from Jeff Garzik.
      Signed-off-by: NGary Zambrano <zambrano@broadcom.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      47b9c3b1
    • A
      [PATCH] AT91RM9200 Ethernet #4: Suspend/Resume · 00e5edcb
      Andrew Victor 提交于
      Adds power-management (suspend/resume) support to the AT91RM9200
      Ethernet driver.
      Patch from David Brownell.
      Signed-off-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      00e5edcb
    • A
      [PATCH] AT91RM9200 Ethernet #3: Cleanup · 427d269f
      Andrew Victor 提交于
      Moved global ether_clk variable into controller data structure.
      Patch from David Brownell.
      
      Davicom 9161 PHY was being incorrectly displayed as "9196".
      Patch from Brian Stafford.
      
      clk_get() doesn't return NULL on error, so the return value needs to be
      tested with IS_ERR().
      
      Whitespace cleanup.
      Signed-off-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      427d269f
    • A
      [PATCH] AT91RM9200 Ethernet #2: MII interface · ca5585ed
      Andrew Victor 提交于
      Adds support for the MII ioctls via generic_mii_ioctl().
      Patch from Brian Stafford.
      
      Set the mii.phy_id to the detected PHY address, otherwise ethtool cannot
      access PHYs other than 0.
      Patch from Roman Kolesnikov.
      Signed-off-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ca5585ed
    • A
      [PATCH] AT91RM9200 Ethernet #1: Link poll · 775637df
      Andrew Victor 提交于
      For Ethernet PHYs that don't have an IRQ pin or boards that don't
      connect the IRQ pin to the processor, we enable a timer to poll the
      PHY's link state.
      
      Patch originally supplied by Eric Benard and Roman Kolesnikov.
      Signed-off-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      775637df
    • R
      [PATCH] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC. · d955d90b
      Ralf Baechle 提交于
      IOC3's homegrown DMA mapping functions that are used to optimize things
      a little on IP27 set the wrong bit.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d955d90b
    • J
      Merge branch 'master' into upstream · dbe1ab95
      Jeff Garzik 提交于
      dbe1ab95
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6 · d588fcbe
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (44 commits)
        [PATCH] I2C: I2C controllers go into right place on sysfs
        [PATCH] hwmon-vid: Add support for Intel Core and Conroe
        [PATCH] lm70: New hardware monitoring driver
        [PATCH] hwmon: Fix the Kconfig header
        [PATCH] i2c-i801: Merge setup function
        [PATCH] i2c-i801: Better pci subsystem integration
        [PATCH] i2c-i801: Cleanups
        [PATCH] i2c-i801: Remove PCI function check
        [PATCH] i2c-i801: Remove force_addr parameter
        [PATCH] i2c-i801: Fix block transaction poll loops
        [PATCH] scx200_acb: Documentation update
        [PATCH] scx200_acb: Mark scx200_acb_probe __init
        [PATCH] scx200_acb: Use PCI I/O resource when appropriate
        [PATCH] i2c: Mark block write buffers as const
        [PATCH] i2c-ocores: Minor cleanups
        [PATCH] abituguru: Fix fan detection
        [PATCH] abituguru: Review fixes
        [PATCH] abituguru: New hardware monitoring driver
        [PATCH] w83792d: Add missing data access locks
        [PATCH] w83792d: Fix setting the PWM value
        ...
      d588fcbe
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/w1-2.6 · eaa85689
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/w1-2.6:
        [PATCH] w1: warning fix
        [PATCH] w1: clean up W1_CON dependency.
        [PATCH] drivers/w1/w1.c: fix a compile error
        [PATCH] W1: fix dependencies of W1_SLAVE_DS2433_CRC
        [PATCH] W1: possible cleanups
        [PATCH] W1: cleanups
        [PATCH] w1 exports
        [PATCH] w1: Use mutexes instead of semaphores.
        [PATCH] w1: Make w1 connector notifications depend on connector.
        [PATCH] w1: netlink: Mark netlink group 1 as unused.
        [PATCH] w1: Move w1-connector definitions into linux/include/connector.h
        [PATCH] w1: Userspace communication protocol over connector.
        [PATCH] w1: Replace dscore and ds_w1_bridge with ds2490 driver.
        [PATCH] w1: Added default generic read/write operations.
      eaa85689
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 · 6c763eb9
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (27 commits)
        [PATCH] PCI: nVidia quirk to make AER PCI-E extended capability visible
        [PATCH] PCI: fix issues with extended conf space when MMCONFIG disabled because of e820
        [PATCH] PCI: Bus Parity Status sysfs interface
        [PATCH] PCI: fix memory leak in MMCONFIG error path
        [PATCH] PCI: fix error with pci_get_device() call in the mpc85xx driver
        [PATCH] PCI: MSI-K8T-Neo2-Fir: run only where needed
        [PATCH] PCI: fix race with pci_walk_bus and pci_destroy_dev
        [PATCH] PCI: clean up pci documentation to be more specific
        [PATCH] PCI: remove unneeded msi code
        [PATCH] PCI: don't move ioapics below PCI bridge
        [PATCH] PCI: cleanup unused variable about msi driver
        [PATCH] PCI: disable msi mode in pci_disable_device
        [PATCH] PCI: Allow MSI to work on kexec kernel
        [PATCH] PCI: AMD 8131 MSI quirk called too late, bus_flags not inherited ?
        [PATCH] PCI: Move various PCI IDs to header file
        [PATCH] PCI Bus Parity Status-broken hardware attribute, EDAC foundation
        [PATCH] PCI: i386/x86_84: disable PCI resource decode on device disable
        [PATCH] PCI ACPI: Rename the functions to avoid multiple instances.
        [PATCH] PCI: don't enable device if already enabled
        [PATCH] PCI: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access
        ...
      6c763eb9
    • R
      [PATCH] x86_64: use select for GART_IOMMU to enable AGP · dcc1a66a
      Roman Zippel 提交于
      The AGP default doesn't work well with other selects, so use a select for
      GART_IOMMU as well.  Remove a redundant default for SWIOTLB as well.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      dcc1a66a
    • R
      [PATCH] zlib_inflate: Upgrade library code to a recent version · 4f3865fb
      Richard Purdie 提交于
      Upgrade the zlib_inflate implementation in the kernel from a patched
      version 1.1.3/4 to a patched 1.2.3.
      
      The code in the kernel is about seven years old and I noticed that the
      external zlib library's inflate performance was significantly faster (~50%)
      than the code in the kernel on ARM (and faster again on x86_32).
      
      For comparison the newer deflate code is 20% slower on ARM and 50% slower
      on x86_32 but gives an approx 1% compression ratio improvement.  I don't
      consider this to be an improvement for kernel use so have no plans to
      change the zlib_deflate code.
      
      Various changes have been made to the zlib code in the kernel, the most
      significant being the extra functions/flush option used by ppp_deflate.
      This update reimplements the features PPP needs to ensure it continues to
      work.
      
      This code has been tested on ARM under both JFFS2 (with zlib compression
      enabled) and ppp_deflate and on x86_32.  JFFS2 sees an approx.  10% real
      world file read speed improvement.
      
      This patch also removes ZLIB_VERSION as it no longer has a correct value.
      We don't need version checks anyway as the kernel's module handling will
      take care of that for us.  This removal is also more in keeping with the
      zlib author's wishes (http://www.zlib.net/zlib_faq.html#faq24) and I've
      added something to the zlib.h header to note its a modified version.
      Signed-off-by: NRichard Purdie <rpurdie@rpsys.net>
      Acked-by: NJoern Engel <joern@wh.fh-wedel.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4f3865fb
    • B
      [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use · 4f1bcaf0
      Bjorn Helgaas 提交于
      VGA_MAP_MEM translates to ioremap() on some architectures.  It makes sense
      to do this to vga_vram_base, because we're going to access memory between
      vga_vram_base and vga_vram_end.
      
      But it doesn't really make sense to map starting at vga_vram_end, because
      we aren't going to access memory starting there.  On ia64, which always has
      to be different, ioremapping vga_vram_end gives you something completely
      incompatible with ioremapped vga_vram_start, so vga_vram_size ends up being
      nonsense.
      
      As a bonus, we often know the size up front, so we can use ioremap()
      correctly, rather than giving it a zero size.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4f1bcaf0
    • A
      [PATCH] prune_one_dentry() tweaks · d702ccb3
      Andrew Morton 提交于
      - Add description of d_lock handling to comments over prune_one_dentry().
      
      - It has three callsites - uninline it, saving 200 bytes of text.
      
      Cc: Jan Blunck <jblunck@suse.de>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: Olaf Hering <olh@suse.de>
      Cc: Balbir Singh <balbir@in.ibm.com>
      Cc: Neil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d702ccb3
    • N
      [PATCH] Fix dcache race during umount · 0feae5c4
      NeilBrown 提交于
      The race is that the shrink_dcache_memory shrinker could get called while a
      filesystem is being unmounted, and could try to prune a dentry belonging to
      that filesystem.
      
      If it does, then it will call in to iput on the inode while the dentry is
      no longer able to be found by the umounting process.  If iput takes a
      while, generic_shutdown_super could get all the way though
      shrink_dcache_parent and shrink_dcache_anon and invalidate_inodes without
      ever waiting on this particular inode.
      
      Eventually the superblock gets freed anyway and if the iput tried to touch
      it (which some filesystems certainly do), it will lose.  The promised
      "Self-destruct in 5 seconds" doesn't lead to a nice day.
      
      The race is closed by holding s_umount while calling prune_one_dentry on
      someone else's dentry.  As a down_read_trylock is used,
      shrink_dcache_memory will no longer try to prune the dentry of a filesystem
      that is being unmounted, and unmount will not be able to start until any
      such active prune_one_dentry completes.
      
      This requires that prune_dcache *knows* which filesystem (if any) it is
      doing the prune on behalf of so that it can be careful of other
      filesystems.  shrink_dcache_memory isn't called it on behalf of any
      filesystem, and so is careful of everything.
      
      shrink_dcache_anon is now passed a super_block rather than the s_anon list
      out of the superblock, so it can get the s_anon list itself, and can pass
      the superblock down to prune_dcache.
      
      If prune_dcache finds a dentry that it cannot free, it leaves it where it
      is (at the tail of the list) and exits, on the assumption that some other
      thread will be removing that dentry soon.  To try to make sure that some
      work gets done, a limited number of dnetries which are untouchable are
      skipped over while choosing the dentry to work on.
      
      I believe this race was first found by Kirill Korotaev.
      
      Cc: Jan Blunck <jblunck@suse.de>
      Acked-by: NKirill Korotaev <dev@openvz.org>
      Cc: Olaf Hering <olh@suse.de>
      Acked-by: NBalbir Singh <balbir@in.ibm.com>
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NBalbir Singh <balbir@in.ibm.com>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0feae5c4
    • R
      [PATCH] avoid tasklist_lock at getrusage for multithreaded case too · de047c1b
      Ravikiran G Thirumalai 提交于
      Avoid taking tasklist_lock for at getrusage for the multithreaded case too.
      We don't need to take the tasklist lock for thread traversal of a process
      since Oleg's do-__unhash_process-under-siglock.patch and related work.
      Signed-off-by: NRavikiran Thirumalai <kiran@scalex86.org>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      de047c1b
    • M
      [PATCH] remove steal_locks() · c89681ed
      Miklos Szeredi 提交于
      This patch removes the steal_locks() function.
      
      steal_locks() doesn't work correctly with any filesystem that does it's own
      lock management, including NFS, CIFS, etc.
      
      In addition it has weird semantics on local filesystems in case tasks
      sharing file-descriptor tables are doing POSIX locking operations in
      parallel to execve().
      
      The steal_locks() function has an effect on applications doing:
      
      clone(CLONE_FILES)
        /* in child */
        lock
        execve
        lock
      
      POSIX locks acquired before execve (by "child", "parent" or any further
      task sharing files_struct) will after the execve be owned exclusively by
      "child".
      
      According to Chris Wright some LSB/LTP kind of suite triggers without the
      stealing behavior, but there's no known real-world application that would
      also fail.
      
      Apps using NPTL are not affected, since all other threads are killed before
      execve.
      
      Apps using LinuxThreads are only affected if they
      
        - have multiple threads during exec (LinuxThreads doesn't kill other
          threads, the app may do it with pthread_kill_other_threads_np())
        - rely on POSIX locks being inherited across exec
      
      Both conditions are documented, but not their interaction.
      
      Apps using clone() natively are affected if they
      
        - use clone(CLONE_FILES)
        - rely on POSIX locks being inherited across exec
      
      The above scenarios are unlikely, but possible.
      
      If the patch is vetoed, there's a plan B, that involves mostly keeping the
      weird stealing semantics, but changing the way lock ownership is handled so
      that network and local filesystems work consistently.
      
      That would add more complexity though, so this solution seems to be
      preferred by most people.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Matthew Wilcox <willy@debian.org>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Steven French <sfrench@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c89681ed
    • O
      [PATCH] Fix a race condition between ->i_mapping and iput() · 09d967c6
      OGAWA Hirofumi 提交于
      This race became a cause of oops, and can reproduce by the following.
      
          while true; do
      	dd if=/dev/zero of=/dev/.static/dev/hdg1 bs=512 count=1000 & sync
          done
      
      This race condition was between __sync_single_inode() and iput().
      
                cpu0 (fs's inode)                 cpu1 (bdev's inode)
                -----------------                 -------------------
                                             close("/dev/hda2")
                                             [...]
      __sync_single_inode()
         /* copy the bdev's ->i_mapping */
         mapping = inode->i_mapping;
      
                                             generic_forget_inode()
                                                bdev_clear_inode()
      					     /* restre the fs's ->i_mapping */
      				             inode->i_mapping = &inode->i_data;
      				          /* bdev's inode was freed */
                                                destroy_inode(inode);
      
         if (wait) {
            /* dereference a freed bdev's mapping->host */
            filemap_fdatawait(mapping);  /* Oops */
      
      Since __sync_single_inode() is only taking a ref-count of fs's inode, the
      another process can be close() and freeing the bdev's inode while writing
      fs's inode.  So, __sync_signle_inode() accesses the freed ->i_mapping,
      oops.
      
      This patch takes a ref-count on the bdev's inode for the fs's inode before
      setting a ->i_mapping, and the clear_inode() of the fs's inode does iput() on
      the bdev's inode.  So if the fs's inode is still living, bdev's inode
      shouldn't be freed.
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      09d967c6
    • B
      [PATCH] PCI: Add PCI_CAP_ID_VNDR · 0e5b3781
      Brice Goglin 提交于
      Add the vendor-specific extended capability PCI_CAP_ID_VNDR.  It is required
      by the Myri-10G Ethernet driver.
      Signed-off-by: NBrice Goglin <brice@myri.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0e5b3781
    • A
      [PATCH] myri10ge build fix · bec0e859
      Andrew Morton 提交于
      Someone changed skb_linearize().
      
      Cc: Brice Goglin <bgoglin@myri.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      bec0e859
    • A
      [PATCH] suspend_console() warning fix · 6cc07191
      Andrew Morton 提交于
      kernel/power/main.c: In function 'suspend_prepare':
      kernel/power/main.c:89: warning: implicit declaration of function 'suspend_console'
      kernel/power/main.c: In function 'suspend_finish':
      kernel/power/main.c:137: warning: implicit declaration of function 'resume_console'
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6cc07191
    • D
      [PATCH] Keys: Fix race between two instantiators of a key · 04c567d9
      David Howells 提交于
      Add a revocation notification method to the key type and calls it whilst
      the key's semaphore is still write-locked after setting the revocation
      flag.
      
      The patch then uses this to maintain a reference on the task_struct of the
      process that calls request_key() for as long as the authorisation key
      remains unrevoked.
      
      This fixes a potential race between two processes both of which have
      assumed the authority to instantiate a key (one may have forked the other
      for example).  The problem is that there's no locking around the check for
      revocation of the auth key and the use of the task_struct it points to, nor
      does the auth key keep a reference on the task_struct.
      
      Access to the "context" pointer in the auth key must thenceforth be done
      with the auth key semaphore held.  The revocation method is called with the
      target key semaphore held write-locked and the search of the context
      process's keyrings is done with the auth key semaphore read-locked.
      
      The check for the revocation state of the auth key just prior to searching
      it is done after the auth key is read-locked for the search.  This ensures
      that the auth key can't be revoked between the check and the search.
      
      The revocation notification method is added so that the context task_struct
      can be released as soon as instantiation happens rather than waiting for
      the auth key to be destroyed, thus avoiding the unnecessary pinning of the
      requesting process.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      04c567d9
    • M
      [PATCH] selinux: add hooks for key subsystem · d720024e
      Michael LeMay 提交于
      Introduce SELinux hooks to support the access key retention subsystem
      within the kernel.  Incorporate new flask headers from a modified version
      of the SELinux reference policy, with support for the new security class
      representing retained keys.  Extend the "key_alloc" security hook with a
      task parameter representing the intended ownership context for the key
      being allocated.  Attach security information to root's default keyrings
      within the SELinux initialization routine.
      
      Has passed David's testsuite.
      Signed-off-by: NMichael LeMay <mdlemay@epoch.ncsc.mil>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d720024e
    • A
      [PATCH] NTFS: Critical bug fix (affects MIPS and possibly others) · f893afbe
      Anton Altaparmakov 提交于
      Many thanks to Pauline Ng for the detailed bug report and analysis!
      Signed-off-by: NAnton Altaparmakov <aia21@cantab.net>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f893afbe
    • A
      [PATCH] sparc build breakage · 5d2170ad
      Al Viro 提交于
      rd_prompt et.al.  depend on CONFIG_BLK_DEV_RAM, not CONFIG_BLK_INITRD; now
      that those are independent, setup.c blows with INITRD on and BLK_DEV_RAM
      off.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5d2170ad