21 Oct, 2011

1 commit


03 Aug, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (31 commits)
    Btrfs: don't call writepages from within write_full_page
    Btrfs: Remove unused variable 'last_index' in file.c
    Btrfs: clean up for find_first_extent_bit()
    Btrfs: clean up for wait_extent_bit()
    Btrfs: clean up for insert_state()
    Btrfs: remove unused members from struct extent_state
    Btrfs: clean up code for merging extent maps
    Btrfs: clean up code for extent_map lookup
    Btrfs: clean up search_extent_mapping()
    Btrfs: remove redundant code for dir item lookup
    Btrfs: make acl functions really no-op if acl is not enabled
    Btrfs: remove remaining ref-cache code
    Btrfs: remove a BUG_ON() in btrfs_commit_transaction()
    Btrfs: use wait_event()
    Btrfs: check the nodatasum flag when writing compressed files
    Btrfs: copy string correctly in INO_LOOKUP ioctl
    Btrfs: don't print the leaf if we had an error
    btrfs: make btrfs_set_root_node void
    Btrfs: fix oops while writing data to SSD partitions
    Btrfs: Protect the readonly flag of block group
    ...

    Fix up trivial conflicts (due to acl and writeback cleanups) in
    - fs/btrfs/acl.c
    - fs/btrfs/ctree.h
    - fs/btrfs/extent_io.c

    Linus Torvalds
     

02 Aug, 2011

1 commit


01 Aug, 2011

2 commits


26 Jul, 2011

4 commits

  • Replace the ->check_acl method with a ->get_acl method that simply reads an
    ACL from disk after having a cache miss. This means we can replace the ACL
    checking boilerplate code with a single implementation in namei.c.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • new helper: posix_acl_create(&acl, gfp, mode_p). Replaces acl with
    modified clone, on failure releases acl and replaces with NULL.
    Returns 0 or -ve on error. All callers of posix_acl_create_masq()
    switched.

    Signed-off-by: Al Viro

    Al Viro
     
  • new helper: posix_acl_chmod(&acl, gfp, mode). Replaces acl with modified
    clone or with NULL if that has failed; returns 0 or -ve on error. All
    callers of posix_acl_chmod_masq() switched to that - they'd been doing
    exactly the same thing.

    Signed-off-by: Al Viro

    Al Viro
     
  • This moves logic for checking the cached ACL values from low-level
    filesystems into generic code. The end result is a streamlined ACL
    check that doesn't need to load the inode->i_op->check_acl pointer at
    all for the common cached case.

    The filesystems also don't need to check for a non-blocking RCU walk
    case in their acl_check() functions, because that is all handled at a
    VFS layer.

    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro

    Linus Torvalds
     

20 Jul, 2011

2 commits


23 May, 2011

1 commit


16 May, 2011

1 commit


15 May, 2011

1 commit


02 May, 2011

1 commit

  • use IS_ERR_OR_NULL when possible, done by this coccinelle script:

    @ match @
    identifier id;
    @@
    (
    - BUG_ON(IS_ERR(id) || !id);
    + BUG_ON(IS_ERR_OR_NULL(id));
    |
    - IS_ERR(id) || !id
    + IS_ERR_OR_NULL(id)
    |
    - !id || IS_ERR(id)
    + IS_ERR_OR_NULL(id)
    )

    Signed-off-by: David Sterba

    David Sterba
     

19 Apr, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (24 commits)
    Btrfs: fix free space cache leak
    Btrfs: avoid taking the chunk_mutex in do_chunk_alloc
    Btrfs end_bio_extent_readpage should look for locked bits
    Btrfs: don't force chunk allocation in find_free_extent
    Btrfs: Check validity before setting an acl
    Btrfs: Fix incorrect inode nlink in btrfs_link()
    Btrfs: Check if btrfs_next_leaf() returns error in btrfs_real_readdir()
    Btrfs: Check if btrfs_next_leaf() returns error in btrfs_listxattr()
    Btrfs: make uncache_state unconditional
    btrfs: using cached extent_state in set/unlock combinations
    Btrfs: avoid taking the trans_mutex in btrfs_end_transaction
    Btrfs: fix subvolume mount by name problem when default mount subvolume is set
    fix user annotation in ioctl.c
    Btrfs: check for duplicate iov_base's when doing dio reads
    btrfs: properly handle overlapping areas in memmove_extent_buffer
    Btrfs: fix memory leaks in btrfs_new_inode()
    Btrfs: check for duplicate iov_base's when doing dio reads
    Btrfs: reuse the extent_map we found when calling btrfs_get_extent
    Btrfs: do not use async submit for small DIO io's
    Btrfs: don't split dio bios if we don't have to
    ...

    Linus Torvalds
     

13 Apr, 2011

1 commit


24 Mar, 2011

1 commit


08 Feb, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (33 commits)
    Btrfs: Fix page count calculation
    btrfs: Drop __exit attribute on btrfs_exit_compress
    btrfs: cleanup error handling in btrfs_unlink_inode()
    Btrfs: exclude super blocks when we read in block groups
    Btrfs: make sure search_bitmap finds something in remove_from_bitmap
    btrfs: fix return value check of btrfs_start_transaction()
    btrfs: checking NULL or not in some functions
    Btrfs: avoid uninit variable warnings in ordered-data.c
    Btrfs: catch errors from btrfs_sync_log
    Btrfs: make shrink_delalloc a little friendlier
    Btrfs: handle no memory properly in prepare_pages
    Btrfs: do error checking in btrfs_del_csums
    Btrfs: use the global block reserve if we cannot reserve space
    Btrfs: do not release more reserved bytes to the global_block_rsv than we need
    Btrfs: fix check_path_shared so it returns the right value
    btrfs: check return value of btrfs_start_ioctl_transaction() properly
    btrfs: fix return value check of btrfs_join_transaction()
    fs/btrfs/inode.c: Add missing IS_ERR test
    btrfs: fix missing break in switch phrase
    btrfs: fix several uncheck memory allocations
    ...

    Linus Torvalds
     

29 Jan, 2011

1 commit


27 Jan, 2011

1 commit

  • Steps to reproduce:

    # mkfs.btrfs /dev/sda2
    # mount /dev/sda2 /mnt
    # touch /mnt/file0
    # setfacl -m 'u:root:x,g::x,o::x' /mnt/file0
    # umount /mnt
    # mount /dev/sda2 -o noacl /mnt
    # getfacl /mnt/file0
    ...
    user::rw-
    user:root:--x
    group::--x
    mask::--x
    other::--x

    The output should be:

    user::rw-
    group::--x
    other::--x

    Signed-off-by: Miao Xie
    Signed-off-by: Li Zefan

    Miao Xie
     

18 Jan, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (25 commits)
    Btrfs: forced readonly mounts on errors
    btrfs: Require CAP_SYS_ADMIN for filesystem rebalance
    Btrfs: don't warn if we get ENOSPC in btrfs_block_rsv_check
    btrfs: Fix memory leak in btrfs_read_fs_root_no_radix()
    btrfs: check NULL or not
    btrfs: Don't pass NULL ptr to func that may deref it.
    btrfs: mount failure return value fix
    btrfs: Mem leak in btrfs_get_acl()
    btrfs: fix wrong free space information of btrfs
    btrfs: make the chunk allocator utilize the devices better
    btrfs: restructure find_free_dev_extent()
    btrfs: fix wrong calculation of stripe size
    btrfs: try to reclaim some space when chunk allocation fails
    btrfs: fix wrong data space statistics
    fs/btrfs: Fix build of ctree
    Btrfs: fix off by one while setting block groups readonly
    Btrfs: Add BTRFS_IOC_SUBVOL_GETFLAGS/SETFLAGS ioctls
    Btrfs: Add readonly snapshots support
    Btrfs: Refactor btrfs_ioctl_snap_create()
    btrfs: Extract duplicate decompress code
    ...

    Linus Torvalds
     

17 Jan, 2011

1 commit

  • It seems to me that we leak the memory allocated to 'value' in
    btrfs_get_acl() if the call to posix_acl_from_xattr() fails.
    Here's a patch that attempts to correct that problem.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Chris Mason

    Jesper Juhl
     

07 Jan, 2011

2 commits


12 Jun, 2010

4 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
    Btrfs: The file argument for fsync() is never null
    Btrfs: handle ERR_PTR from posix_acl_from_xattr()
    Btrfs: avoid BUG when dropping root and reference in same transaction
    Btrfs: prohibit a operation of changing acl's mask when noacl mount option used
    Btrfs: should add a permission check for setfacl
    Btrfs: btrfs_lookup_dir_item() can return ERR_PTR
    Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
    Btrfs: unwind after btrfs_start_transaction() errors
    Btrfs: btrfs_iget() returns ERR_PTR
    Btrfs: handle kzalloc() failure in open_ctree()
    Btrfs: handle error returns from btrfs_lookup_dir_item()
    Btrfs: Fix BUG_ON for fs converted from extN
    Btrfs: Fix null dereference in relocation.c
    Btrfs: fix remap_file_pages error
    Btrfs: uninitialized data is check_path_shared()
    Btrfs: fix fallocate regression
    Btrfs: fix loop device on top of btrfs

    Linus Torvalds
     
  • posix_acl_from_xattr() returns both ERR_PTRs and null, but it's OK to
    pass null values to set_cached_acl()

    Signed-off-by: Dan Carpenter
    Signed-off-by: Chris Mason

    Dan Carpenter
     
  • when used Posix File System Test Suite(pjd-fstest) to test btrfs,
    some cases about setfacl failed when noacl mount option used.
    I simplified used commands in pjd-fstest, and the following steps
    can reproduce it.
    ------------------------
    # cd btrfs-part/
    # mkdir aaa
    # setfacl -m m::rw aaa
    Signed-off-by: Chris Mason

    Shi Weihua
     
  • On btrfs, do the following
    ------------------
    # su user1
    # cd btrfs-part/
    # touch aaa
    # getfacl aaa
    # file: aaa
    # owner: user1
    # group: user1
    user::rw-
    group::rw-
    other::r--
    # su user2
    # cd btrfs-part/
    # setfacl -m u::rwx aaa
    # getfacl aaa
    # file: aaa
    # owner: user1
    # group: user1
    user::rwx
    Signed-off-by: Chris Mason

    Shi Weihua
     

22 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

30 Jan, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
    Btrfs: check total number of devices when removing missing
    Btrfs: check return value of open_bdev_exclusive properly
    Btrfs: do not mark the chunk as readonly if in degraded mode
    Btrfs: run orphan cleanup on default fs root
    Btrfs: fix a memory leak in btrfs_init_acl
    Btrfs: Use correct values when updating inode i_size on fallocate
    Btrfs: remove tree_search() in extent_map.c
    Btrfs: Add mount -o compress-force

    Linus Torvalds
     

29 Jan, 2010

1 commit


21 Jan, 2010

1 commit


18 Jan, 2010

1 commit


18 Dec, 2009

2 commits


17 Dec, 2009

1 commit

  • Add a flags argument to struct xattr_handler and pass it to all xattr
    handler methods. This allows using the same methods for multiple
    handlers, e.g. for the ACL methods which perform exactly the same action
    for the access and default ACLs, just using a different underlying
    attribute. With a little more groundwork it'll also allow sharing the
    methods for the regular user/trusted/secure handlers in extN, ocfs2 and
    jffs2 like it's already done for xfs in this patch.

    Also change the inode argument to the handlers to a dentry to allow
    using the handlers mechnism for filesystems that require it later,
    e.g. cifs.

    [with GFS2 bits updated by Steven Whitehouse ]

    Signed-off-by: Christoph Hellwig
    Reviewed-by: James Morris
    Acked-by: Joel Becker
    Signed-off-by: Al Viro

    Christoph Hellwig
     

14 Oct, 2009

1 commit


30 Sep, 2009

1 commit