1. 14 10月, 2014 1 次提交
    • D
      CacheFiles: Fix incorrect test for in-memory object collision · a30efe26
      David Howells 提交于
      When CacheFiles cache objects are in use, they have in-memory representations,
      as defined by the cachefiles_object struct.  These are kept in a tree rooted in
      the cache and indexed by dentry pointer (since there's a unique mapping between
      object index key and dentry).
      
      Collisions can occur between a representation already in the tree and a new
      representation being set up because it takes time to dispose of an old
      representation - particularly if it must be unlinked or renamed.
      
      When such a collision occurs, cachefiles_mark_object_active() is meant to check
      to see if the old, already-present representation is in the process of being
      discarded (ie. FSCACHE_OBJECT_IS_LIVE is not set on it) - and, if so, wait for
      the representation to be removed (ie. CACHEFILES_OBJECT_ACTIVE is then
      cleared).
      
      However, the test for whether the old representation is still live is checking
      the new object - which always will be live at this point.  This leads to an
      oops looking like:
      
      	CacheFiles: Error: Unexpected object collision
      	object: OBJ1b354
      	objstate=LOOK_UP_OBJECT fl=8 wbusy=2 ev=0[0]
      	ops=0 inp=0 exc=0
      	parent=ffff88053f5417c0
      	cookie=ffff880538f202a0 [pr=ffff8805381b7160 nd=ffff880509c6eb78 fl=27]
      	key=[8] '2490000000000000'
      	xobject: OBJ1a600
      	xobjstate=DROP_OBJECT fl=70 wbusy=2 ev=0[0]
      	xops=0 inp=0 exc=0
      	xparent=ffff88053f5417c0
      	xcookie=ffff88050f4cbf70 [pr=ffff8805381b7160 nd=          (null) fl=12]
      	------------[ cut here ]------------
      	kernel BUG at fs/cachefiles/namei.c:200!
      	...
      	Workqueue: fscache_object fscache_object_work_func [fscache]
      	...
      	RIP: ... cachefiles_walk_to_object+0x7ea/0x860 [cachefiles]
      	...
      	Call Trace:
      	 [<ffffffffa04dadd8>] ? cachefiles_lookup_object+0x58/0x100 [cachefiles]
      	 [<ffffffffa01affe9>] ? fscache_look_up_object+0xb9/0x1d0 [fscache]
      	 [<ffffffffa01afc4d>] ? fscache_parent_ready+0x2d/0x80 [fscache]
      	 [<ffffffffa01b0672>] ? fscache_object_work_func+0x92/0x1f0 [fscache]
      	 [<ffffffff8107e82b>] ? process_one_work+0x16b/0x400
      	 [<ffffffff8107fc16>] ? worker_thread+0x116/0x380
      	 [<ffffffff8107fb00>] ? manage_workers.isra.21+0x290/0x290
      	 [<ffffffff81085edc>] ? kthread+0xbc/0xe0
      	 [<ffffffff81085e20>] ? flush_kthread_worker+0x80/0x80
      	 [<ffffffff81502d0c>] ? ret_from_fork+0x7c/0xb0
      	 [<ffffffff81085e20>] ? flush_kthread_worker+0x80/0x80
      Reported-by: NManuel Schölling <manuel.schoelling@gmx.de>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NSteve Dickson <steved@redhat.com>
      a30efe26
  2. 30 9月, 2014 1 次提交
    • D
      CacheFiles: Handle object being killed before being set up · a3b7c004
      David Howells 提交于
      If a cache object gets killed whilst in the process of being set up - for
      instance if the netfs relinquishes the cookie that the object is associated
      with - then the object's state machine will transit to the DROP_OBJECT state
      without necessarily going through the LOOKUP_OBJECT or CREATE_OBJECT states.
      
      This is a problem for CacheFiles because cachefiles_drop_object() assumes that
      object->dentry will be set upon reaching the DROP_OBJECT state and has an
      ASSERT() to that effect (see the oops below) - but object->dentry doesn't get
      set until the LOOKUP_OBJECT or CREATE_OBJECT states (and not always then if
      they fail).
      
      To fix this, just make the dentry cleanup in cachefiles_drop_object()
      conditional on the dentry actually being set and remove the assertion.
      
      	CacheFiles: Assertion failed
      	------------[ cut here ]------------
      	kernel BUG at .../fs/cachefiles/namei.c:425!
      	...
      	Workqueue: fscache_object fscache_object_work_func [fscache]
      	...
      	RIP: ... cachefiles_delete_object+0xcd/0x110 [cachefiles]
      	...
      	Call Trace:
      	 [<ffffffffa043280f>] ? cachefiles_drop_object+0xff/0x130 [cachefiles]
      	 [<ffffffffa02ac511>] ? fscache_drop_object+0xd1/0x1d0 [fscache]
      	 [<ffffffffa02ac697>] ? fscache_object_work_func+0x87/0x210 [fscache]
      	 [<ffffffff81080635>] ? process_one_work+0x155/0x450
      	 [<ffffffff81081c44>] ? worker_thread+0x114/0x370
      	 [<ffffffff81081b30>] ? manage_workers.isra.21+0x2c0/0x2c0
      	 [<ffffffff81087fcc>] ? kthread+0xbc/0xe0
      	 [<ffffffff81087f10>] ? flush_kthread_worker+0xa0/0xa0
      	 [<ffffffff8150638c>] ? ret_from_fork+0x7c/0xb0
      	 [<ffffffff81087f10>] ? flush_kthread_worker+0xa0/0xa0
      Reported-by: NManuel Schölling <manuel.schoelling@gmx.de>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NSteve Dickson <steved@redhat.com>
      a3b7c004
  3. 29 9月, 2014 2 次提交
  4. 28 9月, 2014 7 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 1e3827bf
      Linus Torvalds 提交于
      Pull vfs fixes from Al Viro:
       "Assorted fixes + unifying __d_move() and __d_materialise_dentry() +
        minimal regression fix for d_path() of victims of overwriting rename()
        ported on top of that"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        vfs: Don't exchange "short" filenames unconditionally.
        fold swapping ->d_name.hash into switch_names()
        fold unlocking the children into dentry_unlock_parents_for_move()
        kill __d_materialise_dentry()
        __d_materialise_dentry(): flip the order of arguments
        __d_move(): fold manipulations with ->d_child/->d_subdirs
        don't open-code d_rehash() in d_materialise_unique()
        pull rehashing and unlocking the target dentry into __d_materialise_dentry()
        ufs: deal with nfsd/iget races
        fuse: honour max_read and max_write in direct_io mode
        shmem: fix nlink for rename overwrite directory
      1e3827bf
    • L
      Merge branch 'for-3.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 6111da34
      Linus Torvalds 提交于
      Pull cgroup fixes from Tejun Heo:
       "This is quite late but these need to be backported anyway.
      
        This is the fix for a long-standing cpuset bug which existed from
        2009.  cpuset makes use of PF_SPREAD_{PAGE|SLAB} flags to modify the
        task's memory allocation behavior according to the settings of the
        cpuset it belongs to; unfortunately, when those flags have to be
        changed, cpuset did so directly even whlie the target task is running,
        which is obviously racy as task->flags may be modified by the task
        itself at any time.  This obscure bug manifested as corrupt
        PF_USED_MATH flag leading to a weird crash.
      
        The bug is fixed by moving the flag to task->atomic_flags.  The first
        two are prepatory ones to help defining atomic_flags accessors and the
        third one is the actual fix"
      
      * 'for-3.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags
        sched: add macros to define bitops for task atomic flags
        sched: fix confusing PFA_NO_NEW_PRIVS constant
      6111da34
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 83692898
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "Here's our last set of fixes for 3.17.  Most of these are for TI
        platforms, fixing some noisy Kconfig issues, runtime clock and power
        issues on several platforms and NAND timings on DRA7.
      
        There are also a couple of bug fixes for i.MX, one for QCOM and a
       small fix to avoid section mismatch noise on PXA.
      
        Diffstat looks large, partially due to some tables being updated and
        thus touching many lines.  The qcom gsbi change also restructures
        clock management a bit and thus touches a bunch of lines.
      
        All in all, a bit more changes than we'd like at this point, but
        nothing stands out as risky either so it seems like the right thing to
        send it up now instead of holding it to the merge window"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        drivers/soc: qcom: do not disable the iface clock in probe
        ARM: imx: fix .is_enabled() of shared gate clock
        ARM: OMAP3: Fix I/O chain clock line assertion timed out error
        ARM: keystone: dts: fix bindings for pcie and usb clock nodes
        bus: omap_l3_noc: Fix connID for OMAP4
        ARM: DT: imx53: fix lvds channel 1 port
        ARM: dts: cm-t54: fix serial console power supply.
        ARM: dts: dra7-evm: Fix NAND GPMC timings
        ARM: pxa: fix section mismatch warning for pxa_timer_nodt_init
        ARM: OMAP: Fix Kconfig warning for omap1
      83692898
    • L
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 74807afd
      Linus Torvalds 提交于
      Pull MIPS fixes from Ralf Baechle:
       "The final round of fixes.  One corner case in the math emulator and
        another one in the mcount function for ftrace"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: mcount: Adjust stack pointer for static trace in MIPS32
        MIPS: Fix MFC1 & MFHC1 emulation for 64-bit MIPS systems
      74807afd
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cd40fab6
      Linus Torvalds 提交于
      Pull x86 fixes from Ingo Molnar:
       "This has:
      
         - EFI revert to fix a boot regression
         - early_ioremap() fix for boot failure
         - KASLR fix for possible boot failures
         - EFI fix for corrupted string printing
         - remove a misleading EFI bootup 'failed!' error message
      
        Unfortunately it's all rather close to the merge window"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/efi: Truncate 64-bit values when calling 32-bit OutputString()
        x86/efi: Delete misleading efi_printk() error message
        Revert "efi/x86: efistub: Move shared dependencies to <asm/efi.h>"
        x86/kaslr: Avoid the setup_data area when picking location
        x86 early_ioremap: Increase FIX_BTMAPS_SLOTS to 8
      cd40fab6
    • M
      vfs: Don't exchange "short" filenames unconditionally. · d2fa4a84
      Mikhail Efremov 提交于
      Only exchange source and destination filenames
      if flags contain RENAME_EXCHANGE.
      In case if executable file was running and replaced by
      other file /proc/PID/exe should still show correct file name,
      not the old name of the file by which it was replaced.
      
      The scenario when this bug manifests itself was like this:
      * ALT Linux uses rpm and start-stop-daemon;
      * during a package upgrade rpm creates a temporary file
        for an executable to rename it upon successful unpacking;
      * start-stop-daemon is run subsequently and it obtains
        the (nonexistant) temporary filename via /proc/PID/exe
        thus failing to identify the running process.
      
      Note that "long" filenames (> DNAiME_INLINE_LEN) are still
      exchanged without RENAME_EXCHANGE and this behaviour exists
      long enough (should be fixed too apparently).
      So this patch is just an interim workaround that restores
      behavior for "short" names as it was before changes
      introduced by commit da1ce067 ("vfs: add cross-rename").
      
      See https://lkml.org/lkml/2014/9/7/6 for details.
      
      AV: the comments about being more careful with ->d_name.hash
      than with ->d_name.name are from back in 2.3.40s; they
      became obsolete by 2.3.60s, when we started to unhash the
      target instead of swapping hash chain positions followed
      by d_delete() as we used to do when dcache was first
      introduced.
      Acked-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: linux-fsdevel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Fixes: da1ce067 "vfs: add cross-rename"
      Signed-off-by: NMikhail Efremov <sem@altlinux.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d2fa4a84
    • L
      fold swapping ->d_name.hash into switch_names() · a28ddb87
      Linus Torvalds 提交于
      and do it along with ->d_name.len there
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a28ddb87
  5. 27 9月, 2014 10 次提交
  6. 26 9月, 2014 19 次提交