1. 14 7月, 2012 21 次提交
    • A
      get rid of ->mnt_longterm · f7a99c5b
      Al Viro 提交于
      it's enough to set ->mnt_ns of internal vfsmounts to something
      distinct from all struct mnt_namespace out there; then we can
      just use the check for ->mnt_ns != NULL in the fast path of
      mntput_no_expire()
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f7a99c5b
    • J
      fs/direct-io.c: adjust suspicious bit operation · d187663e
      Julia Lawall 提交于
      READ is 0, so the result of the bit-and operation is 0.  Rewrite with == as
      done elsewhere in the same file.
      
      This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d187663e
    • A
      affs: get rid of affs_sync_super · 3dd84782
      Artem Bityutskiy 提交于
      This patch makes affs stop using the VFS '->write_super()' method along with
      the 's_dirt' superblock flag, because they are on their way out.
      
      The whole "superblock write-out" VFS infrastructure is served by the
      'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
      writes out all dirty superblocks using the '->write_super()' call-back.  But the
      problem with this thread is that it wastes power by waking up the system every
      5 seconds, even if there are no diry superblocks, or there are no client
      file-systems which would need this (e.g., btrfs does not use
      '->write_super()'). So we want to kill it completely and thus, we need to make
      file-systems to stop using the '->write_super()' VFS service, and then remove
      it together with the kernel thread.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3dd84782
    • A
      affs: introduce VFS superblock object back-reference · a215fef7
      Artem Bityutskiy 提交于
      Add an 'sb' VFS superblock back-reference to the 'struct affs_sb_info' data
      structure - we will need to find the VFS superblock from a 'struct
      affs_sb_info' object in the next patch, so this change is jut a preparation.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a215fef7
    • A
      affs: stop using lock_super · a8371074
      Artem Bityutskiy 提交于
      The VFS's 'lock_super()' and 'unlock_super()' calls are deprecated and unwanted
      and just wait for a brave knight who'd kill them. This patch makes AFFS stop
      using them and use the buffer-head's own lock instead.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a8371074
    • A
      affs: re-structure superblock locking a bit · e0471c8d
      Artem Bityutskiy 提交于
      AFFS wants to serialize the superblock (the root block in AFFS terms) updates
      and uses 'lock_super()/unlock_super()' for these purposes. This patch pushes the
      locking down to the 'affs_commit_super()' from the callers.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e0471c8d
    • A
      affs: remove useless superblock writeout on remount · 0164b1a3
      Artem Bityutskiy 提交于
      We do not need to write out the superblock from '->remount_fs()' because
      VFS has already called '->sync_fs()' by this time and the superblock has
      already been written out. Thus, remove the 'affs_write_super()'
      infocation from 'affs_remount()'.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0164b1a3
    • A
      affs: remove useless superblock writeout on unmount · c9753b1d
      Artem Bityutskiy 提交于
      We do not need to write out the superblock from '->put_super()' because VFS has
      already called '->sync_fs()' by this time and the superblock has already been
      written out. Thus, remove the 'affs_commit_super()' infocation from
      'affs_put_super()'.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c9753b1d
    • A
      affs: stop setting bm_flags · bc86256d
      Artem Bityutskiy 提交于
      AFFS stores values '1' and '2' in 'bm_flags', and I fail to see any logic when
      it prefers one or another. AFFS writes '1' only from '->put_super()', while
      '->sync_fs()' and '->write_super()' store value '2'.  So on the first glance,
      it looks like we want to have '1' if we unmount.  However, this does not really
      happen in these cases:
        1. superblock is written via 'write_super()' then we unmount;
        2. we re-mount R/O, then unmount.
      which are quite typical.
      
      I could not find good documentation describing this field, except of one random
      piece of documentation in the internet which says that -1 means that the root
      block is valid, which is not consistent with what we have in the Linux AFFS
      driver.
      
      Jan Kara commented on this: "I have some vague recollection that on Amiga
      boolean was usually encoded as: 0 == false, ~0 == -1 == true. But it has been
      ages..."
      
      Thus, my conclusion is that value of '1' is as good as value of '2' and we can
      just always use '2'. An Jan Kara suggested to go further: "generally bm_flags
      handling looks strange. If they are 0, we mount fs read only and thus cannot
      change them.  If they are != 0, we write 2 there. So IMHO if you just removed
      bm_flags setting, nothing will really happen."
      
      So this patch removes the bm_flags setting completely. This makes the "clean"
      argument of the 'affs_commit_super()' function unneeded, so it is also removed.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bc86256d
    • L
      Merge tag 'md-3.5-fixes' of git://neil.brown.name/md · fdb1335a
      Linus Torvalds 提交于
      Pull use-after-free RAID1 bugfix from NeilBrown.
      
      * tag 'md-3.5-fixes' of git://neil.brown.name/md:
        md/raid1: fix use-after-free bug in RAID1 data-check code.
      fdb1335a
    • L
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d55e5bd0
      Linus Torvalds 提交于
      Pull the leap second fixes from Thomas Gleixner:
       "It's a rather large series, but well discussed, refined and reviewed.
        It got a massive testing by John, Prarit and tip.
      
        In theory we could split it into two parts.  The first two patches
      
          f55a6faa: hrtimer: Provide clock_was_set_delayed()
          4873fa07: timekeeping: Fix leapsecond triggered load spike issue
      
        are merely preventing the stuff loops forever issues, which people
        have observed.
      
        But there is no point in delaying the other 4 commits which achieve
        full correctness into 3.6 as they are tagged for stable anyway.  And I
        rather prefer to have the full fixes merged in bulk than a "prevent
        the observable wreckage and deal with the hidden fallout later"
        approach."
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        hrtimer: Update hrtimer base offsets each hrtimer_interrupt
        timekeeping: Provide hrtimer update function
        hrtimers: Move lock held region in hrtimer_interrupt()
        timekeeping: Maintain ktime_t based offsets for hrtimers
        timekeeping: Fix leapsecond triggered load spike issue
        hrtimer: Provide clock_was_set_delayed()
      d55e5bd0
    • W
      x86/vsyscall: allow seccomp filter in vsyscall=emulate · 5651721e
      Will Drewry 提交于
      If a seccomp filter program is installed, older static binaries and
      distributions with older libc implementations (glibc 2.13 and earlier)
      that rely on vsyscall use will be terminated regardless of the filter
      program policy when executing time, gettimeofday, or getcpu.  This is
      only the case when vsyscall emulation is in use (vsyscall=emulate is the
      default).
      
      This patch emulates system call entry inside a vsyscall=emulate by
      populating regs->ax and regs->orig_ax with the system call number prior
      to calling into seccomp such that all seccomp-dependencies function
      normally.  Additionally, system call return behavior is emulated in line
      with other vsyscall entrypoints for the trace/trap cases.
      
      [ v2: fixed ip and sp on SECCOMP_RET_TRAP/TRACE (thanks to luto@mit.edu) ]
      Reported-and-tested-by: NOwen Kibel <qmewlo@gmail.com>
      Signed-off-by: NWill Drewry <wad@chromium.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5651721e
    • L
      Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · ac7d181e
      Linus Torvalds 提交于
      Please pull one hwmon subsystem fix from Jean Delvare.
      
      * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        hwmon: (it87) Preserve configuration register bits on init
      ac7d181e
    • L
      Merge tag 'nfs-for-3.5-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 4264e6a2
      Linus Torvalds 提交于
      Pull NFS client bugfixes from Trond Myklebust:
       - Fix an NFSv4 mount regression
       - Fix O_DIRECT list manipulation snafus
      
      * tag 'nfs-for-3.5-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: Fix an NFSv4 mount regression
        NFS: Fix list manipulation snafus in fs/nfs/direct.c
      4264e6a2
    • D
      Remove easily user-triggerable BUG from generic_setlease · 8d657eb3
      Dave Jones 提交于
      This can be trivially triggered from userspace by passing in something unexpected.
      
          kernel BUG at fs/locks.c:1468!
          invalid opcode: 0000 [#1] SMP
          RIP: 0010:generic_setlease+0xc2/0x100
          Call Trace:
            __vfs_setlease+0x35/0x40
            fcntl_setlease+0x76/0x150
            sys_fcntl+0x1c6/0x810
            system_call_fastpath+0x1a/0x1f
      Signed-off-by: NDave Jones <davej@redhat.com>
      Cc: stable@kernel.org # 3.2+
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d657eb3
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 39ea32ca
      Linus Torvalds 提交于
      Pull input layer fixes from Dmitry Torokhov:
       "The changes are limited to adding new VID/PID combinations to drivers
        to enable support for new versions of hardware, most notably hardware
        found in new MacBook Pro Retina boxes."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: xpad - add Andamiro Pump It Up pad
        Input: xpad - add signature for Razer Onza Tournament Edition
        Input: xpad - handle all variations of Mad Catz Beat Pad
        Input: bcm5974 - Add support for 2012 MacBook Pro Retina
        HID: add support for 2012 MacBook Pro Retina
      39ea32ca
    • L
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 8488e408
      Linus Torvalds 提交于
      Pull media fixes from Mauro Carvalho Chehab:
       - Some regression fixes at the audio part for devices with
         cx23885/cx25840
       - A DMA corruption fix at cx231xx
       - two fixes at the winbond IR driver
       - Several fixes for the EXYNOS media driver (s5p)
       - two fixes at the OMAP3 preview driver
       - one fix at the dvb core failure path
       - an include missing (slab.h) at smiapp-core causing compilation
         breakage
       - em28xx was not loading the IR driver driver anymore.
      
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (31 commits)
        [media] Revert "[media] V4L: JPEG class documentation corrections"
        [media] s5p-fimc: Add missing FIMC-LITE file operations locking
        [media] omap3isp: preview: Fix contrast and brightness handling
        [media] omap3isp: preview: Fix output size computation depending on input format
        [media] winbond-cir: Initialise timeout, driver_type and allowed_protos
        [media] winbond-cir: Fix txandrx module info
        [media] cx23885: Silence unknown command warnings
        [media] cx23885: add support for HVR-1255 analog (cx23888 variant)
        [media] cx23885: make analog support work for HVR_1250 (cx23885 variant)
        [media] cx25840: fix vsrc/hsrc usage on cx23888 designs
        [media] cx25840: fix regression in HVR-1800 analog audio
        [media] cx25840: fix regression in analog support hue/saturation controls
        [media] cx25840: fix regression in HVR-1800 analog support
        [media] s5p-mfc: Fixed setup of custom controls in decoder and encoder
        [media] cx231xx: don't DMA to random addresses
        [media] em28xx: fix em28xx-rc load
        [media] dvb-core: Release semaphore on error path dvb_register_device()
        [media] s5p-fimc: Stop media entity pipeline if fimc_pipeline_validate fails
        [media] s5p-fimc: Fix compiler warning in fimc-lite.c
        [media] s5p-fimc: media_entity_pipeline_start() may fail
        ...
      8488e408
    • L
      Merge tag 'mmc-fixes-for-3.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 2c913900
      Linus Torvalds 提交于
      Pull MMC fixes from Chris Ball:
       - Revert a patch that made failing to select power class fatal;
         it turns out that it fails non-fatally on Tegra boards.
         Regression against 3.5-rc1.
       - Add the IRQF_ONESHOT flag to the cd-gpio driver, which turned
         into a regression in 3.5-rc1 when IRQF_ONESHOT became required
         for threaded IRQs with no handler.
      
      * tag 'mmc-fixes-for-3.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        mmc: cd-gpio: pass IRQF_ONESHOT to request_threaded_irq()
        mmc: core: Revert "skip card initialization if power class selection fails"
      2c913900
    • L
      Merge tag 'for-linus-20120712' of git://git.infradead.org/linux-mtd · 36ec9fbf
      Linus Torvalds 提交于
      Pull late MTD fixes from David Woodhouse:
       - fix 'sparse warning fix' regression which totally breaks MXC NAND
       - fix GPMI NAND regression when used with UBI
       - update/correct sysfs documentation for new 'bitflip_threshold' field
       - fix nandsim build failure
      
      * tag 'for-linus-20120712' of git://git.infradead.org/linux-mtd:
        mtd: nandsim: don't open code a do_div helper
        mtd: ABI documentation: clarification of bitflip_threshold
        mtd: gpmi-nand: fix read page when reading to vmalloced area
        mtd: mxc_nand: use 32bit copy functions
      36ec9fbf
    • L
      Merge tag 'mfd-for-linus-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 7801dc33
      Linus Torvalds 提交于
      Pull MFD Fixes from Samuel Ortiz:
       - Three Palmas fixes, One of them being a build error fix.
       - Two mc13xx fixes.  One for fixing an SPI regmap configuration and
         another one for working around an i.Mx hardware bug.
       - One omap-usb regression fix.
       - One twl6040 build breakage fix.
       - One file deletion (ab5500-core.h) that was overlooked during the last
         merge window.
      
      * tag 'mfd-for-linus-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: Add missing hunk to change palmas irq to clear on read
        mfd: Fix palmas regulator pdata missing
        mfd: USB: Fix the omap-usb EHCI ULPI PHY reset fix issues.
        mfd: Update twl6040 Kconfig to avoid build breakage
        mfd: Delete ab5500-core.h
        mfd: mc13xxx workaround SPI hardware bug on i.Mx
        mfd: Fix mc13xxx SPI regmap
        mfd: Add terminating entry for i2c_device_id palmas table
      7801dc33
    • L
      Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh · 68394bfb
      Linus Torvalds 提交于
      Pull SuperH fixes from Paul Mundt.
      
      * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
        SH: Convert out[bwl] macros to inline functions
        sh: Fix up se7721 GPIOLIB=y build warnings.
      68394bfb
  2. 13 7月, 2012 4 次提交
  3. 12 7月, 2012 15 次提交
    • C
      SH: Convert out[bwl] macros to inline functions · 44033109
      Corey Minyard 提交于
      The macros just called BUG(), but that results in unused variable
      warnings all over the place, like in the IPMI driver.  The build
      regression emails were annoying me, so here's the fix.  I have
      not even compile tested this, but it's rather obvious.
      
      [ port type mangled to unsigned long ]
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      44033109
    • L
      Merge tag 'fbdev-fixes-for-3.5-2' of git://github.com/schandinat/linux-2.6 · 918227bb
      Linus Torvalds 提交于
      Pull fbdev fixes from Florian Tobias Schandinat:
       "Two fixes for OMAPDSS by Tomi Valkeinen:
         - one to avoid warnings when runtime PM is not enabled
         - one workaround to dependancy issues during suspend/resume"
      
      * tag 'fbdev-fixes-for-3.5-2' of git://github.com/schandinat/linux-2.6:
        OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n
        OMAPDSS: Use PM notifiers for system suspend
      918227bb
    • L
      Merge branch 'akpm' (Andrew's patch-bomb) · 00c3e276
      Linus Torvalds 提交于
      Merge random patches from Andrew Morton.
      
      * Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (32 commits)
        memblock: free allocated memblock_reserved_regions later
        mm: sparse: fix usemap allocation above node descriptor section
        mm: sparse: fix section usemap placement calculation
        xtensa: fix incorrect memset
        shmem: cleanup shmem_add_to_page_cache
        shmem: fix negative rss in memcg memory.stat
        tmpfs: revert SEEK_DATA and SEEK_HOLE
        drivers/rtc/rtc-twl.c: fix threaded IRQ to use IRQF_ONESHOT
        fat: fix non-atomic NFS i_pos read
        MAINTAINERS: add OMAP CPUfreq driver to OMAP Power Management section
        sgi-xp: nested calls to spin_lock_irqsave()
        fs: ramfs: file-nommu: add SetPageUptodate()
        drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning
        mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails
        h8300/uaccess: add mising __clear_user()
        h8300/uaccess: remove assignment to __gu_val in unhandled case of get_user()
        h8300/time: add missing #include <asm/irq_regs.h>
        h8300/signal: fix typo "statis"
        h8300/pgtable: add missing #include <asm-generic/pgtable.h>
        drivers/rtc/rtc-ab8500.c: ensure correct probing of the AB8500 RTC when Device Tree is enabled
        ...
      00c3e276
    • Y
      memblock: free allocated memblock_reserved_regions later · 29f67386
      Yinghai Lu 提交于
      memblock_free_reserved_regions() calls memblock_free(), but
      memblock_free() would double reserved.regions too, so we could free the
      old range for reserved.regions.
      
      Also tj said there is another bug which could be related to this.
      
      | I don't think we're saving any noticeable
      | amount by doing this "free - give it to page allocator - reserve
      | again" dancing.  We should just allocate regions aligned to page
      | boundaries and free them later when memblock is no longer in use.
      
      in that case, when DEBUG_PAGEALLOC, will get panic:
      
           memblock_free: [0x0000102febc080-0x0000102febf080] memblock_free_reserved_regions+0x37/0x39
        BUG: unable to handle kernel paging request at ffff88102febd948
        IP: [<ffffffff836a5774>] __next_free_mem_range+0x9b/0x155
        PGD 4826063 PUD cf67a067 PMD cf7fa067 PTE 800000102febd160
        Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
        CPU 0
        Pid: 0, comm: swapper Not tainted 3.5.0-rc2-next-20120614-sasha #447
        RIP: 0010:[<ffffffff836a5774>]  [<ffffffff836a5774>] __next_free_mem_range+0x9b/0x155
      
      See the discussion at https://lkml.org/lkml/2012/6/13/469
      
      So try to allocate with PAGE_SIZE alignment and free it later.
      Reported-by: NSasha Levin <levinsasha928@gmail.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      29f67386
    • Y
      mm: sparse: fix usemap allocation above node descriptor section · 99ab7b19
      Yinghai Lu 提交于
      After commit f5bf18fa ("bootmem/sparsemem: remove limit constraint
      in alloc_bootmem_section"), usemap allocations may easily be placed
      outside the optimal section that holds the node descriptor, even if
      there is space available in that section.  This results in unnecessary
      hotplug dependencies that need to have the node unplugged before the
      section holding the usemap.
      
      The reason is that the bootmem allocator doesn't guarantee a linear
      search starting from the passed allocation goal but may start out at a
      much higher address absent an upper limit.
      
      Fix this by trying the allocation with the limit at the section end,
      then retry without if that fails.  This keeps the fix from f5bf18fa
      of not panicking if the allocation does not fit in the section, but
      still makes sure to try to stay within the section at first.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: <stable@vger.kernel.org>	[3.3.x, 3.4.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      99ab7b19
    • Y
      mm: sparse: fix section usemap placement calculation · 07b4e2bc
      Yinghai Lu 提交于
      Commit 238305bb ("mm: remove sparsemem allocation details from the
      bootmem allocator") introduced a bug in the allocation goal calculation
      that put section usemaps not in the same section as the node
      descriptors, creating unnecessary hotplug dependencies between them:
      
        node 0 must be removed before remove section 16399
        node 1 must be removed before remove section 16399
        node 2 must be removed before remove section 16399
        node 3 must be removed before remove section 16399
        node 4 must be removed before remove section 16399
        node 5 must be removed before remove section 16399
        node 6 must be removed before remove section 16399
      
      The reason is that it applies PAGE_SECTION_MASK to the physical address
      of the node descriptor when finding a suitable place to put the usemap,
      when this mask is actually intended to be used with PFNs.  Because the
      PFN mask is wider, the target address will point beyond the wanted
      section holding the node descriptor and the node must be offlined before
      the section holding the usemap can go.
      
      Fix this by extending the mask to address width before use.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      07b4e2bc
    • A
      xtensa: fix incorrect memset · 688bb415
      Alan Cox 提交于
      Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=43871
      
      Reported-by: <dcb314@hotmail.com>
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NChris Zankel <chris@zankel.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      688bb415
    • H
      shmem: cleanup shmem_add_to_page_cache · b065b432
      Hugh Dickins 提交于
      shmem_add_to_page_cache() has three callsites, but only one of them wants
      the radix_tree_preload() (an exceptional entry guarantees that the radix
      tree node is present in the other cases), and only that site can achieve
      mem_cgroup_uncharge_cache_page() (PageSwapCache makes it a no-op in the
      other cases).  We did it this way originally to reflect
      add_to_page_cache_locked(); but it's confusing now, so move the radix_tree
      preloading and mem_cgroup uncharging to that one caller.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b065b432
    • H
      shmem: fix negative rss in memcg memory.stat · d1899228
      Hugh Dickins 提交于
      When adding the page_private checks before calling shmem_replace_page(), I
      did realize that there is a further race, but thought it too unlikely to
      need a hurried fix.
      
      But independently I've been chasing why a mem cgroup's memory.stat
      sometimes shows negative rss after all tasks have gone: I expected it to
      be a stats gathering bug, but actually it's shmem swapping's fault.
      
      It's an old surprise, that when you lock_page(lookup_swap_cache(swap)),
      the page may have been removed from swapcache before getting the lock; or
      it may have been freed and reused and be back in swapcache; and it can
      even be using the same swap location as before (page_private same).
      
      The swapoff case is already secure against this (swap cannot be reused
      until the whole area has been swapped off, and a new swapped on); and
      shmem_getpage_gfp() is protected by shmem_add_to_page_cache()'s check for
      the expected radix_tree entry - but a little too late.
      
      By that time, we might have already decided to shmem_replace_page(): I
      don't know of a problem from that, but I'd feel more at ease not to do so
      spuriously.  And we have already done mem_cgroup_cache_charge(), on
      perhaps the wrong mem cgroup: and this charge is not then undone on the
      error path, because PageSwapCache ends up preventing that.
      
      It's this last case which causes the occasional negative rss in
      memory.stat: the page is charged here as cache, but (sometimes) found to
      be anon when eventually it's uncharged - and in between, it's an
      undeserved charge on the wrong memcg.
      
      Fix this by adding an earlier check on the radix_tree entry: it's
      inelegant to descend the tree twice, but swapping is not the fast path,
      and a better solution would need a pair (try+commit) of memcg calls, and a
      rework of shmem_replace_page() to keep out of the swapcache.
      
      We can use the added shmem_confirm_swap() function to replace the
      find_get_page+page_cache_release we were already doing on the error path.
      And add a comment on that -EEXIST: it seems a peculiar errno to be using,
      but originates from its use in radix_tree_insert().
      
      [It can be surprising to see positive rss left in a memcg's memory.stat
      after all tasks have gone, since it is supposed to count anonymous but not
      shmem.  Aside from sharing anon pages via fork with a task in some other
      memcg, it often happens after swapping: because a swap page can't be freed
      while under writeback, nor while locked.  So it's not an error, and these
      residual pages are easily freed once pressure demands.]
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d1899228
    • H
      tmpfs: revert SEEK_DATA and SEEK_HOLE · f21f8062
      Hugh Dickins 提交于
      Revert 4fb5ef08 ("tmpfs: support SEEK_DATA and SEEK_HOLE").  I believe
      it's correct, and it's been nice to have from rc1 to rc6; but as the
      original commit said:
      
      I don't know who actually uses SEEK_DATA or SEEK_HOLE, and whether it
      would be of any use to them on tmpfs.  This code adds 92 lines and 752
      bytes on x86_64 - is that bloat or worthwhile?
      
      Nobody asked for it, so I conclude that it's bloat: let's revert tmpfs to
      the dumb generic support for v3.5.  We can always reinstate it later if
      useful, and anyone needing it in a hurry can just get it out of git.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Josef Bacik <josef@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Andreas Dilger <adilger@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Marco Stornelli <marco.stornelli@gmail.com>
      Cc: Jeff liu <jeff.liu@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f21f8062
    • K
      drivers/rtc/rtc-twl.c: fix threaded IRQ to use IRQF_ONESHOT · 6b91bf1a
      Kevin Hilman 提交于
      Requesting a threaded interrupt without a primary handler and without
      IRQF_ONESHOT is dangerous, and after commit 1c6c6952 ("genirq: Reject
      bogus threaded irq requests"), these requests are rejected.  This causes
      ->probe() to fail, and the RTC driver not to be availble.
      
      To fix, add IRQF_ONESHOT to the IRQ flags.
      
      Tested on OMAP3730/OveroSTORM and OMAP4430/Panda board using rtcwake to
      wake from system suspend multiple times.
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6b91bf1a
    • S
      fat: fix non-atomic NFS i_pos read · 5d8ecbbc
      Steven J. Magnani 提交于
      fat_encode_fh() can fetch an invalid i_pos value on systems where 64-bit
      accesses are not atomic.  Make it use the same accessor as the rest of the
      FAT code.
      Signed-off-by: NSteven J. Magnani <steve@digidescorp.com>
      Acked-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5d8ecbbc
    • K
      MAINTAINERS: add OMAP CPUfreq driver to OMAP Power Management section · c46938d4
      Kevin Hilman 提交于
      Add the OMAP CPUFreq driver to the list of files in the OMAP Power
      Management section.
      
      I've already been maintaining this driver, this just makes it official.
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c46938d4
    • D
      sgi-xp: nested calls to spin_lock_irqsave() · 8875408a
      Dan Carpenter 提交于
      The code here has a nested spin_lock_irqsave().  It's not needed since
      IRQs are already disabled and it causes a problem because it means that
      IRQs won't be enabled again at the end.  The second call to
      spin_lock_irqsave() will overwrite the value of irq_flags and we can't
      restore the proper settings.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NRobin Holt <holt@sgi.com>
      Cc: Jack Steiner <steiner@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8875408a
    • B
      fs: ramfs: file-nommu: add SetPageUptodate() · fea9f718
      Bob Liu 提交于
      There is a bug in the below scenario for !CONFIG_MMU:
      
       1. create a new file
       2. mmap the file and write to it
       3. read the file can't get the correct value
      
      Because
      
        sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()
      
      which causes the page to be zeroed.
      
      Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
      generic_file_aio_read() do not call simple_readpage().
      Signed-off-by: NBob Liu <lliubbo@gmail.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fea9f718