28 Jan, 2013

1 commit


26 Jan, 2013

1 commit

  • Pull btrfs fixes from Chris Mason:
    "It turns out that we had two crc bugs when running fsx-linux in a
    loop. Many thanks to Josef, Miao Xie, and Dave Sterba for nailing it
    all down. Miao also has a new OOM fix in this v2 pull as well.

    Ilya fixed a regression Liu Bo found in the balance ioctls for pausing
    and resuming a running balance across drives.

    Josef's orphan truncate patch fixes an obscure corruption we'd see
    during xfstests.

    Arne's patches address problems with subvolume quotas. If the user
    destroys quota groups incorrectly the FS will refuse to mount.

    The rest are smaller fixes and plugs for memory leaks."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (30 commits)
    Btrfs: fix repeated delalloc work allocation
    Btrfs: fix wrong max device number for single profile
    Btrfs: fix missed transaction->aborted check
    Btrfs: Add ACCESS_ONCE() to transaction->abort accesses
    Btrfs: put csums on the right ordered extent
    Btrfs: use right range to find checksum for compressed extents
    Btrfs: fix panic when recovering tree log
    Btrfs: do not allow logged extents to be merged or removed
    Btrfs: fix a regression in balance usage filter
    Btrfs: prevent qgroup destroy when there are still relations
    Btrfs: ignore orphan qgroup relations
    Btrfs: reorder locks and sanity checks in btrfs_ioctl_defrag
    Btrfs: fix unlock order in btrfs_ioctl_rm_dev
    Btrfs: fix unlock order in btrfs_ioctl_resize
    Btrfs: fix "mutually exclusive op is running" error code
    Btrfs: bring back balance pause/resume logic
    btrfs: update timestamps on truncate()
    btrfs: fix btrfs_cont_expand() freeing IS_ERR em
    Btrfs: fix a bug when llseek for delalloc bytes behind prealloc extents
    Btrfs: fix off-by-one in lseek
    ...

    Linus Torvalds
     

25 Jan, 2013

9 commits

  • Pull cifs fixes from Steve French:
    "Two small cifs fixes"

    * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
    fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
    cifs: fix srcip_matches() for ipv6

    Linus Torvalds
     
  • btrfs_start_delalloc_inodes() locks the delalloc_inodes list, fetches the
    first inode, unlocks the list, triggers btrfs_alloc_delalloc_work/
    btrfs_queue_worker for this inode, and then it locks the list, checks the
    head of the list again. But because we don't delete the first inode that it
    deals with before, it will fetch the same inode. As a result, this function
    allocates a huge amount of btrfs_delalloc_work structures, and OOM happens.

    Fix this problem by splice this delalloc list.

    Reported-by: Alex Lyakas
    Signed-off-by: Miao Xie
    Signed-off-by: Josef Bacik

    Miao Xie
     
  • The max device number of single profile is 1, not 0 (0 means 'as many as
    possible'). Fix it.

    Cc: Liu Bo
    Signed-off-by: Miao Xie
    Reviewed-by: Liu Bo
    Signed-off-by: Josef Bacik

    Miao Xie
     
  • First, though the current transaction->aborted check can stop the commit early
    and avoid unnecessary operations, it is too early, and some transaction handles
    don't end, those handles may set transaction->aborted after the check.

    Second, when we commit the transaction, we will wake up some worker threads to
    flush the space cache and inode cache. Those threads also allocate some transaction
    handles and may set transaction->aborted if some serious error happens.

    So we need more check for ->aborted when committing the transaction. Fix it.

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

    Miao Xie
     
  • We may access and update transaction->aborted on the different CPUs without
    lock, so we need ACCESS_ONCE() wrapper to prevent the compiler from creating
    unsolicited accesses and make sure we can get the right value.

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

    Miao Xie
     
  • I noticed a WARN_ON going off when adding csums because we were going over
    the amount of csum bytes that should have been allowed for an ordered
    extent. This is a leftover from when we used to hold the csums privately
    for direct io, but now we use the normal ordered sum stuff so we need to
    make sure and check if we've moved on to another extent so that the csums
    are added to the right extent. Without this we could end up with csums for
    bytenrs that don't have extents to cover them yet. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     
  • For compressed extents, the range of checksum is covered by disk length,
    and the disk length is different with ram length, so we need to use disk
    length instead to get us the right checksum.

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

    Liu Bo
     
  • A user reported a BUG_ON(ret) that occured during tree log replay. Ret was
    -EAGAIN, so what I think happened is that we removed an extent that covered
    a bitmap entry and an extent entry. We remove the part from the bitmap and
    return -EAGAIN and then search for the next piece we want to remove, which
    happens to be an entire extent entry, so we just free the sucker and return.
    The problem is ret is still set to -EAGAIN so we trip the BUG_ON(). The
    user used btrfs-zero-log so I'm not 100% sure this is what happened so I've
    added a WARN_ON() to catch the other possibility. Thanks,

    Reported-by: Jan Steffens
    Signed-off-by: Josef Bacik

    Josef Bacik
     
  • We drop the extent map tree lock while we're logging extents, so somebody
    could come in and merge another extent into this one and screw up our
    logging, or they could even remove us from the list which would keep us from
    logging the extent or freeing our ref on it, so we need to make sure to not
    clear LOGGING until after the extent is logged, and then we can merge it to
    adjacent extents. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     

23 Jan, 2013

3 commits

  • When it goes to error through line 144, the memory allocated to *devname is
    not freed, and the caller doesn't free it either in line 250. So we free the
    memroy of *devname in function cifs_compose_mount_options() when it goes to
    error.

    Signed-off-by: Cong Ding
    CC: stable
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Cong Ding
     
  • Pull fuse fixes from Miklos Szeredi:
    "This contain a bugfix for CUSE and miscellaneous small fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: remove unused variable in fuse_try_move_page()
    fuse: make fuse_file_fallocate() static
    fuse: Move CUSE Kconfig entry from fs/Kconfig into fs/fuse/Kconfig
    cuse: fix uninitialized variable warnings
    cuse: do not register multiple devices with identical names
    cuse: use mutex as registration lock instead of spinlocks

    Linus Torvalds
     
  • Pull f2fs fixes from Jaegeuk Kim:
    o Support swap file and link generic_file_remap_pages
    o Enhance the bio streaming flow and free section control
    o Major bug fix on recovery routine
    o Minor bug/warning fixes and code cleanups

    * tag 'f2fs-for-3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (22 commits)
    f2fs: use _safe() version of list_for_each
    f2fs: add comments of start_bidx_of_node
    f2fs: avoid issuing small bios due to several dirty node pages
    f2fs: support swapfile
    f2fs: add remap_pages as generic_file_remap_pages
    f2fs: add __init to functions in init_f2fs_fs
    f2fs: fix the debugfs entry creation path
    f2fs: add global mutex_lock to protect f2fs_stat_list
    f2fs: remove the blk_plug usage in f2fs_write_data_pages
    f2fs: avoid redundant time update for parent directory in f2fs_delete_entry
    f2fs: remove redundant call to set_blocksize in f2fs_fill_super
    f2fs: move f2fs_balance_fs to punch_hole
    f2fs: add f2fs_balance_fs in several interfaces
    f2fs: revisit the f2fs_gc flow
    f2fs: check return value during recovery
    f2fs: avoid null dereference in f2fs_acl_from_disk
    f2fs: initialize newly allocated dnode structure
    f2fs: update f2fs partition info about SIT/NAT layout
    f2fs: update f2fs document to reflect SIT/NAT layout correctly
    f2fs: remove unneeded INIT_LIST_HEAD at few places
    ...

    Linus Torvalds
     

22 Jan, 2013

11 commits


21 Jan, 2013

1 commit

  • srcip_matches() previously had code like this:

    srcip_matches(..., struct sockaddr *rhs) {
    /* ... */
    struct sockaddr_in6 *vaddr6 = (struct sockaddr_in6 *) &rhs;
    return ipv6_addr_equal(..., &vaddr6->sin6_addr);
    }

    which interpreted the values on the stack after the 'rhs' pointer as an
    ipv6 address. The correct thing to do is to use 'rhs', not '&rhs'.

    Signed-off-by: Nickolai Zeldovich
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Nickolai Zeldovich
     

20 Jan, 2013

5 commits


17 Jan, 2013

9 commits

  • The variables mapping,index are initialized but never used
    otherwise, so remove the unused variables.

    dpatch engine is used to auto generate this patch.
    (https://github.com/weiyj/dpatch)

    Signed-off-by: Wei Yongjun
    Signed-off-by: Miklos Szeredi

    Wei Yongjun
     
  • Fix the following sparse warning:

    fs/fuse/file.c:2249:6: warning: symbol 'fuse_file_fallocate' was not declared. Should it be static?

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • Given that CUSE depends on FUSE, it only makes sense to move its
    Kconfig entry into the FUSE Kconfig file. Also, add a few grammatical
    and semantic touchups.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Miklos Szeredi

    Robert P. J. Day
     
  • Fix the following compiler warnings:

    fs/fuse/cuse.c: In function 'cuse_process_init_reply':
    fs/fuse/cuse.c:288:24: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
    fs/fuse/cuse.c:272:14: note: 'val' was declared here
    fs/fuse/cuse.c:284:10: warning: 'key' may be used uninitialized in this function [-Wmaybe-uninitialized]
    fs/fuse/cuse.c:272:8: note: 'key' was declared here

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • Sysfs doesn't allow two devices with the same name, but we register a
    sysfs entry for each cuse device without checking for name collisions.
    This extends the registration to first check whether the name was already
    registered.

    To avoid race-conditions between the name-check and linking the device, we
    need to protect the whole registration with a mutex.

    Signed-off-by: David Herrmann
    Acked-by: Tejun Heo
    Signed-off-by: Miklos Szeredi

    David Herrmann
     
  • We need to check for name-collisions during cuse-device registration. To
    avoid race-conditions, this needs to be protected during the whole device
    registration. Therefore, replace the spinlocks by mutexes first so we can
    safely extend the locked regions to include more expensive or sleeping
    code paths.

    Signed-off-by: David Herrmann
    Acked-by: Tejun Heo
    Signed-off-by: Miklos Szeredi

    David Herrmann
     
  • Pull xfs bugfixes from Ben Myers:

    - fix(es) for compound buffers

    - fix for dquot soft timer asserts due to overflow of d_blk_softlimit

    - fix for regression in dir v2 code introduced in commit 20f7e9f3726a
    ("xfs: factor dir2 block read operations")

    * tag 'for-linus-v3.8-rc4' of git://oss.sgi.com/xfs/xfs:
    xfs: recalculate leaf entry pointer after compacting a dir2 block
    xfs: remove int casts from debug dquot soft limit timer asserts
    xfs: fix the multi-segment log buffer format
    xfs: fix segment in xfs_buf_item_format_segment
    xfs: rename bli_format to avoid confusion with bli_formats
    xfs: use b_maps[] for discontiguous buffers

    Linus Torvalds
     
  • Dave Jones hit this assert when doing a compile on recent git, with
    CONFIG_XFS_DEBUG enabled:

    XFS: Assertion failed: (char *)dup - (char *)hdr == be16_to_cpu(*xfs_dir2_data_unused_tag_p(dup)), file: fs/xfs/xfs_dir2_data.c, line: 828

    Upon further digging, the tag found by xfs_dir2_data_unused_tag_p(dup)
    contained "2" and not the proper offset, and I found that this value was
    changed after the memmoves under "Use a stale leaf for our new entry."
    in xfs_dir2_block_addname(), i.e.

    memmove(&blp[mid + 1], &blp[mid],
    (highstale - mid) * sizeof(*blp));

    overwrote it.

    What has happened is that the previous call to xfs_dir2_block_compact()
    has rearranged things; it changes btp->count as well as the
    blp array. So after we make that call, we must recalculate the
    proper pointer to the leaf entries by making another call to
    xfs_dir2_block_leaf_p().

    Dave provided a metadump image which led to a simple reproducer
    (create a particular filename in the affected directory) and this
    resolves the testcase as well as the bug on his live system.

    Thanks also to dchinner for looking at this one with me.

    Signed-off-by: Eric Sandeen
    Tested-by: Dave Jones
    Reviewed-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Eric Sandeen
     
  • The int casts here make it easy to trigger an assert with a large
    soft limit. For example, set a >4TB soft limit on an empty volume
    to reproduce a (0 > -x) comparison due to an overflow of
    d_blk_softlimit.

    Signed-off-by: Brian Foster
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    Brian Foster