1. 25 2月, 2012 9 次提交
    • O
      epoll: introduce POLLFREE to flush ->signalfd_wqh before kfree() · d80e731e
      Oleg Nesterov 提交于
      This patch is intentionally incomplete to simplify the review.
      It ignores ep_unregister_pollwait() which plays with the same wqh.
      See the next change.
      
      epoll assumes that the EPOLL_CTL_ADD'ed file controls everything
      f_op->poll() needs. In particular it assumes that the wait queue
      can't go away until eventpoll_release(). This is not true in case
      of signalfd, the task which does EPOLL_CTL_ADD uses its ->sighand
      which is not connected to the file.
      
      This patch adds the special event, POLLFREE, currently only for
      epoll. It expects that init_poll_funcptr()'ed hook should do the
      necessary cleanup. Perhaps it should be defined as EPOLLFREE in
      eventpoll.
      
      __cleanup_sighand() is changed to do wake_up_poll(POLLFREE) if
      ->signalfd_wqh is not empty, we add the new signalfd_cleanup()
      helper.
      
      ep_poll_callback(POLLFREE) simply does list_del_init(task_list).
      This make this poll entry inconsistent, but we don't care. If you
      share epoll fd which contains our sigfd with another process you
      should blame yourself. signalfd is "really special". I simply do
      not know how we can define the "right" semantics if it used with
      epoll.
      
      The main problem is, epoll calls signalfd_poll() once to establish
      the connection with the wait queue, after that signalfd_poll(NULL)
      returns the different/inconsistent results depending on who does
      EPOLL_CTL_MOD/signalfd_read/etc. IOW: apart from sigmask, signalfd
      has nothing to do with the file, it works with the current thread.
      
      In short: this patch is the hack which tries to fix the symptoms.
      It also assumes that nobody can take tasklist_lock under epoll
      locks, this seems to be true.
      
      Note:
      
      	- we do not have wake_up_all_poll() but wake_up_poll()
      	  is fine, poll/epoll doesn't use WQ_FLAG_EXCLUSIVE.
      
      	- signalfd_cleanup() uses POLLHUP along with POLLFREE,
      	  we need a couple of simple changes in eventpoll.c to
      	  make sure it can't be "lost".
      Reported-by: NMaxime Bizon <mbizon@freebox.fr>
      Cc: <stable@kernel.org>
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d80e731e
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 855a85f7
      Linus Torvalds 提交于
      Quoth Chris:
       "This is later than I wanted because I got backed up running through
        btrfs bugs from the Oracle QA teams.  But they are all bug fixes that
        we've queued and tested since rc1.
      
        Nothing in particular stands out, this just reflects bug fixing and QA
        done in parallel by all the btrfs developers.  The most user visible
        of these is:
      
          Btrfs: clear the extent uptodate bits during parent transid failures
      
        Because that helps deal with out of date drives (say an iscsi disk
        that has gone away and come back).  The old code wasn't always
        properly retrying the other mirror for this type of failure."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (24 commits)
        Btrfs: fix compiler warnings on 32 bit systems
        Btrfs: increase the global block reserve estimates
        Btrfs: clear the extent uptodate bits during parent transid failures
        Btrfs: add extra sanity checks on the path names in btrfs_mksubvol
        Btrfs: make sure we update latest_bdev
        Btrfs: improve error handling for btrfs_insert_dir_item callers
        Btrfs: be less strict on finding next node in clear_extent_bit
        Btrfs: fix a bug on overcommit stuff
        Btrfs: kick out redundant stuff in convert_extent_bit
        Btrfs: skip states when they does not contain bits to clear
        Btrfs: check return value of lookup_extent_mapping() correctly
        Btrfs: fix deadlock on page lock when doing auto-defragment
        Btrfs: fix return value check of extent_io_ops
        btrfs: honor umask when creating subvol root
        btrfs: silence warning in raid array setup
        btrfs: fix structs where bitfields and spinlock/atomic share 8B word
        btrfs: delalloc for page dirtied out-of-band in fixup worker
        Btrfs: fix memory leak in load_free_space_cache()
        btrfs: don't check DUP chunks twice
        Btrfs: fix trim 0 bytes after a device delete
        ...
      855a85f7
    • L
      Merge tag 'for-linus' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming · ee325324
      Linus Torvalds 提交于
      This is the arch/c6x part of commit 7c431851 ("Kbuild: Use dtc's -d
      (dependency) option") which was dropped because c6x had not yet been
      merged at the time.
      
      * tag 'for-linus' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming:
        Kbuild: Use dtc's -d (dependency) option
      ee325324
    • K
      MAINTAINERS: drop me from PA-RISC maintenance · b38a03b8
      Kyle McMartin 提交于
      I don't even live in the same country as any of my PA-RISC hardware
      these days, so the odds of me touching the code are pretty low.
      (Also re-order things to ensure jejb gets CC'd since he's been the
      primary maintainer for the last few years.)
      Signed-off-by: NKyle McMartin <kyle@mcmartin.ca>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b38a03b8
    • D
      NOMMU: Don't need to clear vm_mm when deleting a VMA · b94cfaf6
      David Howells 提交于
      Don't clear vm_mm in a deleted VMA as it's unnecessary and might
      conceivably break the filesystem or driver VMA close routine.
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b94cfaf6
    • D
      NOMMU: Lock i_mmap_mutex for access to the VMA prio list · 918e556e
      David Howells 提交于
      Lock i_mmap_mutex for access to the VMA prio list to prevent concurrent
      access.  Currently, certain parts of the mmap handling are protected by
      the region mutex, but not all.
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      918e556e
    • L
      Merge tag 'rmobile-for-linus' of git://github.com/pmundt/linux-sh · 37e79cbf
      Linus Torvalds 提交于
      SH/R-Mobile fixes for 3.3-rc5
      
      * tag 'rmobile-for-linus' of git://github.com/pmundt/linux-sh:
        arch/arm/mach-shmobile/board-ag5evm.c: included linux/dma-mapping.h twice
        ARM: mach-shmobile: r8a7779 PFC IPSR4 fix
        ARM: mach-shmobile: sh73a0 PSTR 32-bit access fix
        ARM: mach-shmobile: add GPIO-to-IRQ translation to sh7372
        ARM: mach-shmobile: clock-sh73a0: add DSIxPHY clock support
        arm: fix compile failure in mach-shmobile/board-ag5evm.c
        ARM: mach-shmobile: mackerel: add ak4642 amixer settings on comment
        ARM: mach-shmobile: mackerel: use renesas_usbhs instead of r8a66597_hcd
        ARM: mach-shmobile: simplify MMCIF DMA configuration
        ARM: mach-shmobile: IRQ driven GPIO key support for Kota2
        ARM: mach-shmobile: sh73a0 IRQ sparse alloc fix
        ARM: mach-shmobile: sh73a0 PINT IRQ base fix
      37e79cbf
    • L
      Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh · 0e69e084
      Linus Torvalds 提交于
      SuperH fixes for 3.3-rc5
      
      * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
        sh: Fix sh2a build error for CONFIG_CACHE_WRITETHROUGH
        sh: modify a resource of sh_eth_giga1_resources in board-sh7757lcr
        arch/sh: remove references to cpu_*_map.
        sh: Fix typo in pci-sh7780.c
        sh: add platform_device for SPI1 in setup-sh7757
        sh: modify resource for SPI0 in setup-sh7757
        sh: se7724: fix compile breakage
        sh: clkfwk: bugfix: use clk_reparent() for div6 clocks
        sh: clock-sh7724: fixup sh_fsi clock settings
        sh: sh7757lcr: update to the new MMCIF DMA configuration
        sh: fix the sh_mmcif_plat_data in board-sh7757lcr
        video: pvr2fb: Fix up spurious section mismatch warnings.
        sh: Defer to asm-generic/device.h.
      0e69e084
    • A
      mm: memcg: Correct unregistring of events attached to the same eventfd · 371528ca
      Anton Vorontsov 提交于
      There is an issue when memcg unregisters events that were attached to
      the same eventfd:
      
      - On the first call mem_cgroup_usage_unregister_event() removes all
        events attached to a given eventfd, and if there were no events left,
        thresholds->primary would become NULL;
      
      - Since there were several events registered, cgroups core will call
        mem_cgroup_usage_unregister_event() again, but now kernel will oops,
        as the function doesn't expect that threshold->primary may be NULL.
      
      That's a good question whether mem_cgroup_usage_unregister_event()
      should actually remove all events in one go, but nowadays it can't
      do any better as cftype->unregister_event callback doesn't pass
      any private event-associated cookie. So, let's fix the issue by
      simply checking for threshold->primary.
      
      FWIW, w/o the patch the following oops may be observed:
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
       IP: [<ffffffff810be32c>] mem_cgroup_usage_unregister_event+0x9c/0x1f0
       Pid: 574, comm: kworker/0:2 Not tainted 3.3.0-rc4+ #9 Bochs Bochs
       RIP: 0010:[<ffffffff810be32c>]  [<ffffffff810be32c>] mem_cgroup_usage_unregister_event+0x9c/0x1f0
       RSP: 0018:ffff88001d0b9d60  EFLAGS: 00010246
       Process kworker/0:2 (pid: 574, threadinfo ffff88001d0b8000, task ffff88001de91cc0)
       Call Trace:
        [<ffffffff8107092b>] cgroup_event_remove+0x2b/0x60
        [<ffffffff8103db94>] process_one_work+0x174/0x450
        [<ffffffff8103e413>] worker_thread+0x123/0x2d0
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Michal Hocko <mhocko@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      371528ca
  2. 24 2月, 2012 13 次提交
  3. 23 2月, 2012 9 次提交
    • L
      Btrfs: increase the global block reserve estimates · 5500cdbe
      Liu Bo 提交于
      When doing IO with large amounts of data fragmentation, the global block
      reserve calulations are too low.  This increases them to avoid
      ENOSPC crashes.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      5500cdbe
    • C
      Btrfs: clear the extent uptodate bits during parent transid failures · 50653190
      Chris Mason 提交于
      If btrfs reads a block and finds a parent transid mismatch, it clears
      the uptodate flags on the extent buffer, and the pages inside it.  But
      we only clear the uptodate bits in the state tree if the block straddles
      more than one page.
      
      This is from an old optimization from to reduce contention on the extent
      state tree.  But it is buggy because the code that retries a read from
      a different copy of the block is going to find the uptodate state bits
      set and skip the IO.
      
      The end result of the bug is that we'll never actually read the good
      copy (if there is one).
      
      The fix here is to always clear the uptodate state bits, which is safe
      because this code is only called when the parent transid fails.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      50653190
    • C
    • C
      Btrfs: make sure we update latest_bdev · a6b0d5c8
      Chris Mason 提交于
      When we are setting up the mount, we close all the
      devices that were not actually part of the metadata we found.
      
      But, we don't make sure that one of those devices wasn't
      fs_devices->latest_bdev, which means we can do a use after free
      on the one we closed.
      
      This updates latest_bdev as it goes.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      a6b0d5c8
    • C
      Btrfs: improve error handling for btrfs_insert_dir_item callers · fe66a05a
      Chris Mason 提交于
      This allows us to gracefully continue if we aren't able to insert
      directory items, both for normal files/dirs and snapshots.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      fe66a05a
    • L
      Merge tag 'usb-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 45196cee
      Linus Torvalds 提交于
      USB bugfixes for 3.3-rc4
      
      A number of new device ids, and a cleanup/fix for some of the option
      device ids that shouldn't have been added in the first place.
      
      There's also a few USB 3 fixes for problems that people have reported,
      and a usb-storage bugfix to round it out.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'usb-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: Added Kamstrup VID/PIDs to cp210x serial driver.
        USB: Serial: ti_usb_3410_5052: Add Abbot Diabetes Care cable id
        usb-storage: fix freezing of the scanning thread
        xhci: Fix encoding for HS bulk/control NAK rate.
        USB: Set hub depth after USB3 hub reset
        USB: Fix handoff when BIOS disables host PCI device.
        USB: option: cleanup zte 3g-dongle's pid in option.c
        USB: Don't fail USB3 probe on missing legacy PCI IRQ.
        xhci: Fix oops caused by more USB2 ports than USB3 ports.
        USB: Remove duplicate USB 3.0 hub feature #defines.
      45196cee
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · e2d4370b
      Linus Torvalds 提交于
      Intel, radeon, exynos fixes.
      
      Intel: fixes a few Ivybridge hangs, along with fixing RC6 on SNB (still
      not on, but at least allows for distros to patch it on easily).
      
      radeon: oops reading some files in debugfs that weren't meant to appear,
      a fix that touches a lot of files, so looks worse than it is, it fixes
      an oops if a GPU reset fails and userspace keeps submitting more data,
      along with a minor BIOS fix for newer boards.
      
      exynos: a group of fixes for exynos, they've sent me a few more but
      these were all I got through, and its no hw vanilla kernel users see a
      lot off yet.
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon/kms/atom: dpms bios scratch reg updates
        drm/radeon/kms: properly set accel working flag and bailout when false
        drm/radeon: Only create additional ring debugfs files on Cayman or newer.
        drm/exynos: added postclose to release resource.
        drm/exynos: removed exynos_drm_fbdev_recreate function.
        drm/exynos: fixed page flip issue.
        drm/exynos: added possible_clones setup function.
        drm/exynos: removed pageflip_event_list init code when closed.
        drm/exynos: changed priority of mixer layers.
        drm/exynos: Fix typo in exynos_mixer.c
        drm/i915: do not enable RC6p on Sandy Bridge
        drm/i915: gen7: Disable the RHWO optimization as it can cause GPU hangs.
        drm/i915: gen7: work around a system hang on IVB
        drm/i915: gen7: Implement an L3 caching workaround.
        drm/i915: gen7: implement rczunit workaround
      e2d4370b
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 71c01b9d
      Linus Torvalds 提交于
      It contains 3 important fixes for ColdFire based machines:
       - fix processes getting stuck when running from strace
       - fix kernel vmalloced pages not being visible in all kernel contexts
       - fix shared user pages sometimes being visible in another process
         context
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: Do not set global share for non-kernel shared pages
        m68k: Add shared bit to Coldfire kernel page entries
        m68knommu: fix syscall tracing stuck process
      71c01b9d
    • L
      Merge tag 'nfs-for-3.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 437cf4c7
      Linus Torvalds 提交于
      Bugfixes for the NFS client.
      
      Fix a nasty Oops in the NFSv4 getacl code, another source of infinite
      loops in the NFSv4 state recovery code, and a regression in NFSv4.1
      session initialisation.
      
      Also deal with an NFSv4.1 memory leak.
      
      * tag 'nfs-for-3.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: fix server_scope memory leak
        NFSv4.1: Fix a NFSv4.1 session initialisation regression
        NFSv4: Ensure we throw out bad delegation stateids on NFS4ERR_BAD_STATEID
        NFSv4: Fix an Oops in the NFSv4 getacl code
      437cf4c7
  4. 22 2月, 2012 9 次提交