19 Oct, 2013

2 commits


18 Oct, 2013

1 commit

  • Pull CIFS fixes from Steve French:
    "Five small cifs fixes (includes fixes for: unmount hang, 2 security
    related, symlink, large file writes)"

    * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
    cifs: ntstatus_to_dos_map[] is not terminated
    cifs: Allow LANMAN auth method for servers supporting unencapsulated authentication methods
    cifs: Fix inability to write files >2GB to SMB2/3 shares
    cifs: Avoid umount hangs with smb2 when server is unresponsive
    do not treat non-symlink reparse points as valid symlinks

    Linus Torvalds
     

17 Oct, 2013

6 commits

  • Merge misc fixes from Andrew Morton.

    * emailed patches from Andrew Morton : (21 commits)
    mm: revert mremap pud_free anti-fix
    mm: fix BUG in __split_huge_page_pmd
    swap: fix set_blocksize race during swapon/swapoff
    procfs: call default get_unmapped_area on MMU-present architectures
    procfs: fix unintended truncation of returned mapped address
    writeback: fix negative bdi max pause
    percpu_refcount: export symbols
    fs: buffer: move allocation failure loop into the allocator
    mm: memcg: handle non-error OOM situations more gracefully
    tools/testing/selftests: fix uninitialized variable
    block/partitions/efi.c: treat size mismatch as a warning, not an error
    mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
    mm/zswap: bugfix: memory leak when re-swapon
    mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
    mm: migration: do not lose soft dirty bit if page is in migration state
    gcov: MAINTAINERS: Add an entry for gcov
    mm/hugetlb.c: correct missing private flag clearing
    mm/vmscan.c: don't forget to free shrinker->nr_deferred
    ipc/sem.c: synchronize semop and semctl with IPC_RMID
    ipc: update locking scheme comments
    ...

    Linus Torvalds
     
  • Commit c4fe24485729 ("sparc: fix PCI device proc file mmap(2)") added
    proc_reg_get_unmapped_area in proc_reg_file_ops and
    proc_reg_file_ops_no_compat, by which now mmap always returns EIO if
    get_unmapped_area method is not defined for the target procfs file,
    which causes regression of mmap on /proc/vmcore.

    To address this issue, like get_unmapped_area(), call default
    current->mm->get_unmapped_area on MMU-present architectures if
    pde->proc_fops->get_unmapped_area, i.e. the one in actual file
    operation in the procfs file, is not defined.

    Reported-by: Michael Holzheu
    Signed-off-by: HATAYAMA Daisuke
    Cc: Alexey Dobriyan
    Cc: David S. Miller
    Tested-by: Michael Holzheu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    HATAYAMA Daisuke
     
  • Currently, proc_reg_get_unmapped_area truncates upper 32-bit of the
    mapped virtual address returned from get_unmapped_area method in
    pde->proc_fops due to the variable rv of signed integer on x86_64. This
    is too small to have vitual address of unsigned long on x86_64 since on
    x86_64, signed integer is of 4 bytes while unsigned long is of 8 bytes.
    To fix this issue, use unsigned long instead.

    Fixes a regression added in commit c4fe24485729 ("sparc: fix PCI device
    proc file mmap(2)").

    Signed-off-by: HATAYAMA Daisuke
    Cc: Alexey Dobriyan
    Cc: David S. Miller
    Tested-by: Michael Holzheu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    HATAYAMA Daisuke
     
  • Buffer allocation has a very crude indefinite loop around waking the
    flusher threads and performing global NOFS direct reclaim because it can
    not handle allocation failures.

    The most immediate problem with this is that the allocation may fail due
    to a memory cgroup limit, where flushers + direct reclaim might not make
    any progress towards resolving the situation at all. Because unlike the
    global case, a memory cgroup may not have any cache at all, only
    anonymous pages but no swap. This situation will lead to a reclaim
    livelock with insane IO from waking the flushers and thrashing unrelated
    filesystem cache in a tight loop.

    Use __GFP_NOFAIL allocations for buffers for now. This makes sure that
    any looping happens in the page allocator, which knows how to
    orchestrate kswapd, direct reclaim, and the flushers sensibly. It also
    allows memory cgroups to detect allocations that can't handle failure
    and will allow them to ultimately bypass the limit if reclaim can not
    make progress.

    Reported-by: azurIt
    Signed-off-by: Johannes Weiner
    Cc: Michal Hocko
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • If a page we are inspecting is in swap we may occasionally report it as
    having soft dirty bit (even if it is clean). The pte_soft_dirty helper
    should be called on present pte only.

    Signed-off-by: Cyrill Gorcunov
    Cc: Pavel Emelyanov
    Cc: Andy Lutomirski
    Cc: Matt Mackall
    Cc: Xiao Guangrong
    Cc: Marcelo Tosatti
    Cc: KOSAKI Motohiro
    Cc: Stephen Rothwell
    Cc: Peter Zijlstra
    Cc: "Aneesh Kumar K.V"
    Reviewed-by: Naoya Horiguchi
    Cc: Mel Gorman
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cyrill Gorcunov
     
  • Pull tmpfile fix from Al Viro:
    "A fix for double iput() in ->tmpfile() on ext3 and ext4; I'd fucked it
    up, Miklos has caught it"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    ext[34]: fix double put in tmpfile

    Linus Torvalds
     

16 Oct, 2013

1 commit


15 Oct, 2013

1 commit

  • Functions that walk the ntstatus_to_dos_map[] array could
    run off the end. For example, ntstatus_to_dos() loops
    while ntstatus_to_dos_map[].ntstatus is not 0. Granted,
    this is mostly theoretical, but could be used as a DOS attack
    if the error code in the SMB header is bogus.

    [Might consider adding to stable, as this patch is low risk - Steve]

    Reviewed-by: Jeff Layton
    Signed-off-by: Tim Gardner
    Signed-off-by: Steve French

    Tim Gardner
     

13 Oct, 2013

4 commits

  • Olga reported that file descriptors opened with O_PATH do not work with
    fstatfs(), found during further development of ksh93's thread support.

    There is no reason to not allow O_PATH file descriptors here (fstatfs is
    very much a path operation), so use "fdget_raw()". See commit
    55815f70147d ("vfs: make O_PATH file descriptors usable for 'fstat()'")
    for a very similar issue reported for fstat() by the same team.

    Reported-and-tested-by: ольга крыжановская
    Acked-by: Al Viro
    Cc: stable@kernel.org # O_PATH introduced in 3.0+
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull ext4 bugfixes from Ted Ts'o:
    "A bug fix and performance regression fix for ext4"

    * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: fix memory leak in xattr
    ext4: fix performance regression in writeback of random writes

    Linus Torvalds
     
  • Pull btrfs fixes from Chris Mason:
    "We've got more bug fixes in my for-linus branch:

    One of these fixes another corner of the compression oops from last
    time. Miao nailed down some problems with concurrent snapshot
    deletion and drive balancing.

    I kept out one of his patches for more testing, but these are all
    stable"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: fix oops caused by the space balance and dead roots
    Btrfs: insert orphan roots into fs radix tree
    Btrfs: limit delalloc pages outside of find_delalloc_range
    Btrfs: use right root when checking for hash collision

    Linus Torvalds
     
  • If we take the 2nd retry path in ext4_expand_extra_isize_ea, we
    potentionally return from the function without having freed these
    allocations. If we don't do the return, we over-write the previous
    allocation pointers, so we leak either way.

    Spotted with Coverity.

    [ Fixed by tytso to set is and bs to NULL after freeing these
    pointers, in case in the retry loop we later end up triggering an
    error causing a jump to cleanup, at which point we could have a double
    free bug. -- Ted ]

    Signed-off-by: Dave Jones
    Signed-off-by: "Theodore Ts'o"
    Reviewed-by: Eric Sandeen
    Cc: stable@vger.kernel.org

    Dave Jones
     

11 Oct, 2013

4 commits

  • When doing space balance and subvolume destroy at the same time, we met
    the following oops:

    kernel BUG at fs/btrfs/relocation.c:2247!
    RIP: 0010: [] prepare_to_merge+0x154/0x1f0 [btrfs]
    Call Trace:
    [] relocate_block_group+0x466/0x4e6 [btrfs]
    [] btrfs_relocate_block_group+0x143/0x275 [btrfs]
    [] btrfs_relocate_chunk.isra.27+0x5c/0x5a2 [btrfs]
    [] ? btrfs_item_key_to_cpu+0x15/0x31 [btrfs]
    [] ? btrfs_get_token_64+0x7e/0xcd [btrfs]
    [] ? btrfs_tree_read_unlock_blocking+0xb2/0xb7 [btrfs]
    [] btrfs_balance+0x9c7/0xb6f [btrfs]
    [] btrfs_ioctl_balance+0x234/0x2ac [btrfs]
    [] btrfs_ioctl+0xd87/0x1ef9 [btrfs]
    [] ? path_openat+0x234/0x4db
    [] ? __do_page_fault+0x31d/0x391
    [] ? vma_link+0x74/0x94
    [] vfs_ioctl+0x1d/0x39
    [] do_vfs_ioctl+0x32d/0x3e2
    [] SyS_ioctl+0x57/0x83
    [] ? do_page_fault+0xe/0x10
    [] system_call_fastpath+0x16/0x1b

    It is because we returned the error number if the reference of the root was 0
    when doing space relocation. It was not right here, because though the root
    was dead(refs == 0), but the space it held still need be relocated, or we
    could not remove the block group. So in this case, we should return the root
    no matter it is dead or not.

    Signed-off-by: Miao Xie
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Miao Xie
     
  • Now we don't drop all the deleted snapshots/subvolumes before the space
    balance. It means we have to relocate the space which is held by the dead
    snapshots/subvolumes. So we must into them into fs radix tree, or we would
    forget to commit the change of them when doing transaction commit, and it
    would corrupt the metadata.

    Signed-off-by: Miao Xie
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Miao Xie
     
  • Liu fixed part of this problem and unfortunately I steered him in slightly the
    wrong direction and so didn't completely fix the problem. The problem is we
    limit the size of the delalloc range we are looking for to max bytes and then we
    try to lock that range. If we fail to lock the pages in that range we will
    shrink the max bytes to a single page and re loop. However if our first page is
    inside of the delalloc range then we will end up limiting the end of the range
    to a period before our first page. This is illustrated below

    [0 -------- delalloc range --------- 256mb]
    [page]

    So find_delalloc_range will return with delalloc_start as 0 and end as 128mb,
    and then we will notice that delalloc_start < *start and adjust it up, but not
    adjust delalloc_end up, so things go sideways. To fix this we need to not limit
    the max bytes in find_delalloc_range, but in find_lock_delalloc_range and that
    way we don't end up with this confusion. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • btrfs_rename was using the root of the old dir instead of the root of the new
    dir when checking for a hash collision, so if you tried to move a file into a
    subvol it would freak out because it would see the file you are trying to move
    in its current root. This fixes the bug where this would fail

    btrfs subvol create test1
    btrfs subvol create test2
    mv test1 test2.

    Thanks to Chris Murphy for catching this,

    Cc: stable@vger.kernel.org
    Reported-by: Chris Murphy
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     

07 Oct, 2013

3 commits

  • This allows users to use LANMAN authentication on servers which support
    unencapsulated authentication.

    The patch fixes a regression where users using plaintext authentication
    were no longer able to do so because of changed bought in by patch
    3f618223dc0bdcbc8d510350e78ee2195ff93768

    https://bugzilla.redhat.com/show_bug.cgi?id=1011621

    Reported-by: Panos Kavalagios
    Reviewed-by: Jeff Layton
    Signed-off-by: Sachin Prabhu
    Signed-off-by: Steve French

    Sachin Prabhu
     
  • When connecting to SMB2/3 shares, maximum file size is set to non-LFS maximum in superblock. This is due to cap_large_files bit being different for SMB1 and SMB2/3 (where it is just an internal flag that is not negotiated and the SMB1 one corresponds to multichannel capability, so maybe LFS works correctly if server sends 0x08 flag) while capabilities are checked always for the SMB1 bit in cifs_read_super().

    The patch fixes this by checking for the correct bit according to the protocol version.

    CC: Stable
    Signed-off-by: Jan Klos
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Jan Klos
     
  • Do not send SMB2 Logoff command when reconnecting, the way smb1
    code base works.

    Also, no need to wait for a credit for an echo command when one is already
    in flight.

    Without these changes, umount command hangs if the server is unresponsive
    e.g. hibernating.

    Signed-off-by: Shirish Pargaonkar
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Shirish Pargaonkar
     

06 Oct, 2013

2 commits

  • Windows 8 and later can create NFS symlinks (within reparse points)
    which we were assuming were normal NTFS symlinks and thus reporting
    corrupt paths for. Add check for reparse points to make sure that
    they really are normal symlinks before we try to parse the pathname.

    We also should not be parsing other types of reparse points (DFS
    junctions etc) as if they were a symlink so return EOPNOTSUPP
    on those. Also fix endian errors (we were not parsing symlink
    lengths as little endian).

    This fixes commit d244bf2dfbebfded05f494ffd53659fa7b1e32c1
    which implemented follow link for non-Unix CIFS mounts

    CC: Stable
    Reviewed-by: Andrew Bartlett
    Signed-off-by: Steve French

    Steve French
     
  • Pull btrfs fixes from Chris Mason:
    "This is a small collection of fixes, including a regression fix from
    Liu Bo that solves rare crashes with compression on.

    I've merged my for-linus up to 3.12-rc3 because the top commit is only
    meant for 3.12. The rest of the fixes are also available in my master
    branch on top of my last 3.11 based pull"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    btrfs: Fix crash due to not allocating integrity data for a bioset
    Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing
    Btrfs: eliminate races in worker stopping code
    Btrfs: fix crash of compressed writes
    Btrfs: fix transid verify errors when recovering log tree

    Linus Torvalds
     

05 Oct, 2013

13 commits

  • When btrfs creates a bioset, we must also allocate the integrity data pool.
    Otherwise btrfs will crash when it tries to submit a bio to a checksumming
    disk:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
    IP: [] mempool_alloc+0x4a/0x150
    PGD 2305e4067 PUD 23063d067 PMD 0
    Oops: 0000 [#1] PREEMPT SMP
    Modules linked in: btrfs scsi_debug xfs ext4 jbd2 ext3 jbd mbcache
    sch_fq_codel eeprom lpc_ich mfd_core nfsd exportfs auth_rpcgss af_packet
    raid6_pq xor zlib_deflate libcrc32c [last unloaded: scsi_debug]
    CPU: 1 PID: 4486 Comm: mount Not tainted 3.12.0-rc1-mcsum #2
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff8802451c9720 ti: ffff880230698000 task.ti: ffff880230698000
    RIP: 0010:[] [] mempool_alloc+0x4a/0x150
    RSP: 0018:ffff880230699688 EFLAGS: 00010286
    RAX: 0000000000000001 RBX: 0000000000000000 RCX: 00000000005f8445
    RDX: 0000000000000001 RSI: 0000000000000010 RDI: 0000000000000000
    RBP: ffff8802306996f8 R08: 0000000000011200 R09: 0000000000000008
    R10: 0000000000000020 R11: ffff88009d6e8000 R12: 0000000000011210
    R13: 0000000000000030 R14: ffff8802306996b8 R15: ffff8802451c9720
    FS: 00007f25b8a16800(0000) GS:ffff88024fc80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000018 CR3: 0000000230576000 CR4: 00000000000007e0
    Stack:
    ffff8802451c9720 0000000000000002 ffffffff81a97100 0000000000281250
    ffffffff81a96480 ffff88024fc99150 ffff880228d18200 0000000000000000
    0000000000000000 0000000000000040 ffff880230e8c2e8 ffff8802459dc900
    Call Trace:
    [] bio_integrity_alloc+0x48/0x1b0
    [] bio_integrity_prep+0xac/0x360
    [] ? mempool_alloc+0x58/0x150
    [] ? alloc_extent_state+0x31/0x110 [btrfs]
    [] blk_queue_bio+0x1c9/0x460
    [] generic_make_request+0xca/0x100
    [] submit_bio+0x79/0x160
    [] btrfs_map_bio+0x48e/0x5b0 [btrfs]
    [] btree_submit_bio_hook+0xda/0x110 [btrfs]
    [] submit_one_bio+0x6a/0xa0 [btrfs]
    [] read_extent_buffer_pages+0x250/0x310 [btrfs]
    [] ? __radix_tree_preload+0x66/0xf0
    [] ? radix_tree_insert+0x95/0x260
    [] btree_read_extent_buffer_pages.constprop.128+0xb6/0x120
    [btrfs]
    [] read_tree_block+0x3a/0x60 [btrfs]
    [] open_ctree+0x139d/0x2030 [btrfs]
    [] btrfs_mount+0x53a/0x7d0 [btrfs]
    [] ? pcpu_alloc+0x8eb/0x9f0
    [] ? __kmalloc_track_caller+0x35/0x1e0
    [] mount_fs+0x20/0xd0
    [] vfs_kern_mount+0x76/0x120
    [] do_mount+0x200/0xa40
    [] ? strndup_user+0x5b/0x80
    [] SyS_mount+0x90/0xe0
    [] system_call_fastpath+0x1a/0x1f
    Code: 4c 8d 75 a8 4c 89 6d e8 45 89 e0 4c 8d 6f 30 48 89 5d d8 41 83 e0 af 48
    89 fb 49 83 c6 18 4c 89 7d f8 65 4c 8b 3c 25 c0 b8 00 00 8b 73 18 44 89 c7
    44 89 45 98 ff 53 20 48 85 c0 48 89 c2 74
    RIP [] mempool_alloc+0x4a/0x150
    RSP
    CR2: 0000000000000018
    ---[ end trace 7a96042017ed21e2 ]---

    Signed-off-by: Darrick J. Wong
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Darrick J. Wong
     
  • Chris Mason
     
  • Pull CIFS fixes from Steve French:
    "Small set of cifs fixes. Most important is Jeff's fix that works
    around disconnection problems which can be caused by simultaneous use
    of user space tools (starting a long running smbclient backup then
    doing a cifs kernel mount) or multiple cifs mounts through a NAT, and
    Jim's fix to deal with reexport of cifs share.

    I expect to send two more cifs fixes next week (being tested now) -
    fixes to address an SMB2 unmount hang when server dies and a fix for
    cifs symlink handling of Windows "NFS" symlinks"

    * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
    [CIFS] update cifs.ko version
    [CIFS] Remove ext2 flags that have been moved to fs.h
    [CIFS] Provide sane values for nlink
    cifs: stop trying to use virtual circuits
    CIFS: FS-Cache: Uncache unread pages in cifs_readpages() before freeing them

    Linus Torvalds
     
  • Pull xfs bugfixes from Ben Myers:
    "There are lockdep annotations for project quotas, a fix for dirent
    dtype support on v4 filesystems, a fix for a memory leak in recovery,
    and a fix for the build error that resulted from it. D'oh"

    * tag 'xfs-for-linus-v3.12-rc4' of git://oss.sgi.com/xfs/xfs:
    xfs: Use kmem_free() instead of free()
    xfs: fix memory leak in xlog_recover_add_to_trans
    xfs: dirent dtype presence is dependent on directory magic numbers
    xfs: lockdep needs to know about 3 dquot-deep nesting

    Linus Torvalds
     
  • free_device rcu callback, scheduled from btrfs_rm_dev_replace_srcdev,
    can be processed before btrfs_scratch_superblock is called, which would
    result in a use-after-free on btrfs_device contents. Fix this by
    zeroing the superblock before the rcu callback is registered.

    Cc: Stefan Behrens
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Josef Bacik

    Ilya Dryomov
     
  • The current implementation of worker threads in Btrfs has races in
    worker stopping code, which cause all kinds of panics and lockups when
    running btrfs/011 xfstest in a loop. The problem is that
    btrfs_stop_workers is unsynchronized with respect to check_idle_worker,
    check_busy_worker and __btrfs_start_workers.

    E.g., check_idle_worker race flow:

    btrfs_stop_workers(): check_idle_worker(aworker):
    - grabs the lock
    - splices the idle list into the
    working list
    - removes the first worker from the
    working list
    - releases the lock to wait for
    its kthread's completion
    - grabs the lock
    - if aworker is on the working list,
    moves aworker from the working list
    to the idle list
    - releases the lock
    - grabs the lock
    - puts the worker
    - removes the second worker from the
    working list
    ......
    btrfs_stop_workers returns, aworker is on the idle list
    FS is umounted, memory is freed
    ......
    aworker is waken up, fireworks ensue

    With this applied, I wasn't able to trigger the problem in 48 hours,
    whereas previously I could reliably reproduce at least one of these
    races within an hour.

    Reported-by: David Sterba
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Josef Bacik

    Ilya Dryomov
     
  • The crash[1] is found by xfstests/generic/208 with "-o compress",
    it's not reproduced everytime, but it does panic.

    The bug is quite interesting, it's actually introduced by a recent commit
    (573aecafca1cf7a974231b759197a1aebcf39c2a,
    Btrfs: actually limit the size of delalloc range).

    Btrfs implements delay allocation, so during writeback, we
    (1) get a page A and lock it
    (2) search the state tree for delalloc bytes and lock all pages within the range
    (3) process the delalloc range, including find disk space and create
    ordered extent and so on.
    (4) submit the page A.

    It runs well in normal cases, but if we're in a racy case, eg.
    buffered compressed writes and aio-dio writes,
    sometimes we may fail to lock all pages in the 'delalloc' range,
    in which case, we need to fall back to search the state tree again with
    a smaller range limit(max_bytes = PAGE_CACHE_SIZE - offset).

    The mentioned commit has a side effect, that is, in the fallback case,
    we can find delalloc bytes before the index of the page we already have locked,
    so we're in the case of (delalloc_end 0).

    This ends with not locking delalloc pages but making ->writepage still
    process them, and the crash happens.

    This fixes it by just thinking that we find nothing and returning to caller
    as the caller knows how to deal with it properly.

    [1]:
    ------------[ cut here ]------------
    kernel BUG at mm/page-writeback.c:2170!
    [...]
    CPU: 2 PID: 11755 Comm: btrfs-delalloc- Tainted: G O 3.11.0+ #8
    [...]
    RIP: 0010:[] [] clear_page_dirty_for_io+0x1e/0x83
    [...]
    [ 4934.248731] Stack:
    [ 4934.248731] ffff8801477e5dc8 ffffea00049b9f00 ffff8801869f9ce8 ffffffffa02b841a
    [ 4934.248731] 0000000000000000 0000000000000000 0000000000000fff 0000000000000620
    [ 4934.248731] ffff88018db59c78 ffffea0005da8d40 ffffffffa02ff860 00000001810016c0
    [ 4934.248731] Call Trace:
    [ 4934.248731] [] extent_range_clear_dirty_for_io+0xcf/0xf5 [btrfs]
    [ 4934.248731] [] compress_file_range+0x1dc/0x4cb [btrfs]
    [ 4934.248731] [] ? detach_if_pending+0x22/0x4b
    [ 4934.248731] [] async_cow_start+0x35/0x53 [btrfs]
    [ 4934.248731] [] worker_loop+0x14b/0x48c [btrfs]
    [ 4934.248731] [] ? btrfs_queue_worker+0x25c/0x25c [btrfs]
    [ 4934.248731] [] kthread+0x8d/0x95
    [ 4934.248731] [] ? kthread_freezable_should_stop+0x43/0x43
    [ 4934.248731] [] ret_from_fork+0x7c/0xb0
    [ 4934.248731] [] ? kthread_freezable_should_stop+0x43/0x43
    [ 4934.248731] Code: ff 85 c0 0f 94 c0 0f b6 c0 59 5b 5d c3 0f 1f 44 00 00 55 48 89 e5 41 54 53 48 89 fb e8 2c de 00 00 49 89 c4 48 8b 03 a8 01 75 02 0b 4d 85 e4 74 52 49 8b 84 24 80 00 00 00 f6 40 20 01 75 44
    [ 4934.248731] RIP [] clear_page_dirty_for_io+0x1e/0x83
    [ 4934.248731] RSP
    [ 4934.280307] ---[ end trace 36f06d3f8750236a ]---

    Signed-off-by: Liu Bo
    Signed-off-by: Josef Bacik

    Liu Bo
     
  • If we crash with a log, remount and recover that log, and then crash before we
    can commit another transaction we will get transid verify errors on the next
    mount. This is because we were not zero'ing out the log when we committed the
    transaction after recovery. This is ok as long as we commit another transaction
    at some point in the future, but if you abort or something else goes wrong you
    can end up in this weird state because the recovery stuff says that the tree log
    should have a generation+1 of the super generation, which won't be the case of
    the transaction that was started for recovery. Fix this by removing the check
    and _always_ zero out the log portion of the super when we commit a transaction.
    This fixes the transid verify issues I was seeing with my force errors tests.
    Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     
  • This fixes a build failure caused by calling the free() function which
    does not exist in the Linux kernel.

    Signed-off-by: Thierry Reding
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    (cherry picked from commit aaaae98022efa4f3c31042f1fdf9e7a0c5f04663)

    Thierry Reding
     
  • Free the memory in error path of xlog_recover_add_to_trans().
    Normally this memory is freed in recovery pass2, but is leaked
    in the error path.

    Signed-off-by: Mark Tinguely
    Reviewed-by: Eric Sandeen
    Signed-off-by: Ben Myers

    (cherry picked from commit 519ccb81ac1c8e3e4eed294acf93be00b43dcad6)

    tinguely@sgi.com
     
  • The determination of whether a directory entry contains a dtype
    field originally was dependent on the filesystem having CRCs
    enabled. This meant that the format for dtype beign enabled could be
    determined by checking the directory block magic number rather than
    doing a feature bit check. This was useful in that it meant that we
    didn't need to pass a struct xfs_mount around to functions that
    were already supplied with a directory block header.

    Unfortunately, the introduction of dtype fields into the v4
    structure via a feature bit meant this "use the directory block
    magic number" method of discriminating the dirent entry sizes is
    broken. Hence we need to convert the places that use magic number
    checks to use feature bit checks so that they work correctly and not
    by chance.

    The current code works on v4 filesystems only because the dirent
    size roundup covers the extra byte needed by the dtype field in the
    places where this problem occurs.

    Signed-off-by: Dave Chinner
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    (cherry picked from commit 367993e7c6428cb7617ab7653d61dca54e2fdede)

    Dave Chinner
     
  • Michael Semon reported that xfs/299 generated this lockdep warning:

    =============================================
    [ INFO: possible recursive locking detected ]
    3.12.0-rc2+ #2 Not tainted
    ---------------------------------------------
    touch/21072 is trying to acquire lock:
    (&xfs_dquot_other_class){+.+...}, at: [] xfs_trans_dqlockedjoin+0x57/0x64

    but task is already holding lock:
    (&xfs_dquot_other_class){+.+...}, at: [] xfs_trans_dqlockedjoin+0x57/0x64

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&xfs_dquot_other_class);
    lock(&xfs_dquot_other_class);

    *** DEADLOCK ***

    May be due to missing lock nesting notation

    7 locks held by touch/21072:
    #0: (sb_writers#10){++++.+}, at: [] mnt_want_write+0x1e/0x3e
    #1: (&type->i_mutex_dir_key#4){+.+.+.}, at: [] do_last+0x245/0xe40
    #2: (sb_internal#2){++++.+}, at: [] xfs_trans_alloc+0x1f/0x35
    #3: (&(&ip->i_lock)->mr_lock/1){+.+...}, at: [] xfs_ilock+0x100/0x1f1
    #4: (&(&ip->i_lock)->mr_lock){++++-.}, at: [] xfs_ilock_nowait+0x105/0x22f
    #5: (&dqp->q_qlock){+.+...}, at: [] xfs_trans_dqlockedjoin+0x57/0x64
    #6: (&xfs_dquot_other_class){+.+...}, at: [] xfs_trans_dqlockedjoin+0x57/0x64

    The lockdep annotation for dquot lock nesting only understands
    locking for user and "other" dquots, not user, group and quota
    dquots. Fix the annotations to match the locking heirarchy we now
    have.

    Reported-by: Michael L. Semon
    Signed-off-by: Dave Chinner
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    (cherry picked from commit f112a049712a5c07de25d511c3c6587a2b1a015e)

    Dave Chinner
     
  • Pull fuse bugfixes from Miklos Szeredi:
    "This contains two more fixes by Maxim for writeback/truncate races and
    fixes for RCU walk in fuse_dentry_revalidate()"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: no RCU mode in fuse_access()
    fuse: readdirplus: fix RCU walk
    fuse: don't check_submounts_and_drop() in RCU walk
    fuse: fix fallocate vs. ftruncate race
    fuse: wait for writeback in fuse_file_fallocate()

    Linus Torvalds
     

03 Oct, 2013

1 commit


02 Oct, 2013

2 commits