22 Feb, 2011

9 commits


20 Feb, 2011

1 commit

  • When creating a new dentry we now hold a reference to the parent
    inode in the ceph_dentry. This is required due to the new RCU
    changes from 949854d0, which set dentry->d_parent to NULL in d_kill before
    calling the ->release() callback. If/when that behavior is changed, we can
    revert this hack.

    Signed-off-by: Yehuda Sadeh
    Signed-off-by: Sage Weil

    Yehuda Sadeh
     

19 Feb, 2011

1 commit


18 Feb, 2011

2 commits


17 Feb, 2011

6 commits

  • * 'for-2.6.38' of git://linux-nfs.org/~bfields/linux:
    nfsd: correctly handle return value from nfsd_map_name_to_*

    Linus Torvalds
     
  • The code finds, the '%' sign in an ipv6 address and copies that to a
    buffer allocated on the stack. It then ignores that buffer, and passes
    'pct' to simple_strtoul(), which doesn't work right because we're
    comparing 'endp' against a completely different string.

    Fix it by passing the correct pointer. While we're at it, this is a
    good candidate for conversion to strict_strtoul as well.

    Cc: stable@kernel.org
    Cc: David Howells
    Reported-by: Björn JACKE
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • This reverts commit 75f1dc0d076d ("block: check bdev_read_only() from
    blkdev_get()"). That commit added stricter checking to make sure
    devices that were being used read-only were actually opened in that
    mode.

    It turns out that the change breaks a bunch of kernel code that opens
    block devices. Affected systems include dm, md, and the loop device.
    Because strict checking for read-only opens of block devices was not
    done before this, the code that opens the devices was opening them
    read-write even if they were being used read-only. Auditing all that
    code will take time, and new userspace packages for dm, mdadm, etc.
    will also be required.

    Signed-off-by: Chuck Ebbert
    Signed-off-by: Linus Torvalds

    Chuck Ebbert
     
  • These functions return an nfs status, not a host_err. So don't
    try to convert before returning.

    This is a regression introduced by
    3c726023402a2f3b28f49b9d90ebf9e71151157d; I fixed up two of the callers,
    but missed these two.

    Cc: stable@kernel.org
    Reported-by: Herbert Poetzl
    Signed-off-by: NeilBrown
    Signed-off-by: J. Bruce Fields

    NeilBrown
     
  • When Al moved the nameidata_dentry_drop_rcu_maybe() call into the
    do_follow_link function in commit 844a391799c2 ("nothing in
    do_follow_link() is going to see RCU"), he mistakenly left the

    BUG_ON(inode != path->dentry->d_inode);

    behind. Which would otherwise be ok, but that BUG_ON() really needs to
    be _after_ dropping RCU, since the dentry isn't necessarily stable
    otherwise.

    So complete the code movement in that commit, and move the BUG_ON() into
    do_follow_link() too. This means that we need to pass in 'inode' as an
    argument (just for this one use), but that's a small thing. And
    eventually we may be confident enough in our path lookup that we can
    just remove the BUG_ON() and the unnecessary inode argument.

    Reported-and-tested-by: Eric Dumazet
    Acked-by: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • There are two spellings in use for 'freeze' + 'able' - 'freezable' and
    'freezeable'. The former is the more prominent one. The latter is
    mostly used by workqueue and in a few other odd places. Unify the
    spelling to 'freezable'.

    Signed-off-by: Tejun Heo
    Reported-by: Alan Stern
    Acked-by: "Rafael J. Wysocki"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Dmitry Torokhov
    Cc: David Woodhouse
    Cc: Alex Dubov
    Cc: "David S. Miller"
    Cc: Steven Whitehouse

    Tejun Heo
     

16 Feb, 2011

3 commits

  • * 'for-2.6.38' of git://linux-nfs.org/~bfields/linux:
    nfsd: break lease on unlink due to rename
    nfsd4: acquire only one lease per file
    nfsd4: modify fi_delegations under recall_lock
    nfsd4: remove unused deleg dprintk's.
    nfsd4: split lease setting into separate function
    nfsd4: fix leak on allocation error
    nfsd4: add helper function for lease setup
    nfsd4: split up nfsd_break_deleg_cb
    NFSD: memory corruption due to writing beyond the stat array
    NFSD: use nfserr for status after decode_cb_op_status
    nfsd: don't leak dentry count on mnt_want_write failure

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    get rid of nameidata_dentry_drop_rcu() calling nameidata_drop_rcu()
    drop out of RCU in return_reval
    split do_revalidate() into RCU and non-RCU cases
    in do_lookup() split RCU and non-RCU cases of need_revalidate
    nothing in do_follow_link() is going to see RCU

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
    Btrfs: check return value of alloc_extent_map()
    Btrfs - Fix memory leak in btrfs_init_new_device()
    btrfs: prevent heap corruption in btrfs_ioctl_space_info()
    Btrfs: Fix balance panic
    Btrfs: don't release pages when we can't clear the uptodate bits
    Btrfs: fix page->private races

    Linus Torvalds
     

15 Feb, 2011

12 commits

  • task_show_regs used to be a debugging aid in the early bringup days
    of Linux on s390. /proc//status is a world readable file, it
    is not a good idea to show the registers of a process. The only
    correct fix is to remove task_show_regs.

    Reported-by: Al Viro
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • can't happen anymore and didn't work right anyway

    Signed-off-by: Al Viro

    Al Viro
     
  • ... thus killing the need to handle drop-from-RCU in d_revalidate()

    Signed-off-by: Al Viro

    Al Viro
     
  • fixing oopsen in lookup_one_len()

    Signed-off-by: Al Viro

    Al Viro
     
  • and use unlikely() instead of gotos, for fsck sake...

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • I add the check on the return value of alloc_extent_map() to several places.
    In addition, alloc_extent_map() returns only the address or NULL.
    Therefore, check by IS_ERR() is unnecessary. So, I remove IS_ERR() checking.

    Signed-off-by: Tsutomu Itoh
    Signed-off-by: Chris Mason

    Tsutomu Itoh
     
  • Memory allocated by calling kstrdup() should be freed.

    Signed-off-by: Ilya Dryomov
    Signed-off-by: Chris Mason

    Ilya Dryomov
     
  • Commit bf5fc093c5b625e4259203f1cee7ca73488a5620 refactored
    btrfs_ioctl_space_info() and introduced several security issues.

    space_args.space_slots is an unsigned 64-bit type controlled by a
    possibly unprivileged caller. The comparison as a signed int type
    allows providing values that are treated as negative and cause the
    subsequent allocation size calculation to wrap, or be truncated to 0.
    By providing a size that's truncated to 0, kmalloc() will return
    ZERO_SIZE_PTR. It's also possible to provide a value smaller than the
    slot count. The subsequent loop ignores the allocation size when
    copying data in, resulting in a heap overflow or write to ZERO_SIZE_PTR.

    The fix changes the slot count type and comparison typecast to u64,
    which prevents truncation or signedness errors, and also ensures that we
    don't copy more data than we've allocated in the subsequent loop. Note
    that zero-size allocations are no longer possible since there is already
    an explicit check for space_args.space_slots being 0 and truncation of
    this value is no longer an issue.

    Signed-off-by: Dan Rosenberg
    Signed-off-by: Josef Bacik
    Reviewed-by: Josef Bacik
    Signed-off-by: Chris Mason

    Dan Rosenberg
     
  • Mark the cloned backref_node as checked in clone_backref_node()

    Signed-off-by: Yan, Zheng
    Signed-off-by: Chris Mason

    Yan, Zheng
     
  • Btrfs tracks uptodate state in an rbtree as well as in the
    page bits. This is supposed to enable us to use block sizes other than
    the page size, but there are a few parts still missing before that
    completely works.

    But, our readpage routine trusts this additional range based tracking
    of uptodateness, much in the same way the buffer head up to date bits
    are trusted for the other filesystems.

    The problem is that sometimes we need to allocate memory in order to
    split records in the rbtree, even when we are just clearing bits. This
    can be difficult when our clearing function is called GFP_ATOMIC, which
    can happen in the releasepage path.

    So, what happens today looks like this:

    releasepage called with GFP_ATOMIC
    btrfs_releasepage calls clear_extent_bit
    clear_extent_bit fails to allocate ram, leaving the up to date bit set
    btrfs_releasepage returns success

    The end result is the page being gone, but btrfs thinking the range is
    up to date. Later on if someone tries to read that same page, the
    btrfs readpage code will return immediately thinking the page is already
    up to date.

    This commit fixes things to fail the releasepage when we can't clear the
    extent state bits. It covers both data pages and metadata tree blocks.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • There is a race where btrfs_releasepage can drop the
    page->private contents just as alloc_extent_buffer is setting
    up pages for metadata. Because of how the Btrfs page flags work,
    this results in us skipping the crc on the page during IO.

    This patch sovles the race by waiting until after the extent buffer
    is inserted into the radix tree before it sets page private.

    Signed-off-by: Chris Mason

    Chris Mason
     

14 Feb, 2011

6 commits

  • 4795bb37effb7b8fe77e2d2034545d062d3788a8 "nfsd: break lease on unlink,
    link, and rename", only broke the lease on the file that was being
    renamed, and didn't handle the case where the target path refers to an
    already-existing file that will be unlinked by a rename--in that case
    the target file should have any leases broken as well.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Instead of acquiring one lease each time another client opens a file,
    nfsd can acquire just one lease to represent all of them, and reference
    count it to determine when to release it.

    This fixes a regression introduced by
    c45821d263a8a5109d69a9e8942b8d65bcd5f31a "locks: eliminate fl_mylease
    callback": after that patch, only the struct file * is used to determine
    who owns a given lease. But since we recently converted the server to
    share a single struct file per open, if we acquire multiple leases on
    the same file from nfsd, it then becomes impossible on unlocking a lease
    to determine which of those leases (all of whom share the same struct
    file *) we meant to remove.

    Thanks to Takashi Iwai for catching a bug in a previous
    version of this patch.

    Tested-by: Takashi Iwai
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Modify fi_delegations only under the recall_lock, allowing us to use
    that list on lease breaks.

    Also some trivial cleanup to simplify later changes.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • These aren't all that useful, and get in the way of the next steps.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Splitting some code into a separate function which we'll be adding some
    more to.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Also share some common exit code.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields