11 Dec, 2014

2 commits

  • Pull VFS changes from Al Viro:
    "First pile out of several (there _definitely_ will be more). Stuff in
    this one:

    - unification of d_splice_alias()/d_materialize_unique()

    - iov_iter rewrite

    - killing a bunch of ->f_path.dentry users (and f_dentry macro).

    Getting that completed will make life much simpler for
    unionmount/overlayfs, since then we'll be able to limit the places
    sensitive to file _dentry_ to reasonably few. Which allows to have
    file_inode(file) pointing to inode in a covered layer, with dentry
    pointing to (negative) dentry in union one.

    Still not complete, but much closer now.

    - crapectomy in lustre (dead code removal, mostly)

    - "let's make seq_printf return nothing" preparations

    - assorted cleanups and fixes

    There _definitely_ will be more piles"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
    copy_from_iter_nocache()
    new helper: iov_iter_kvec()
    csum_and_copy_..._iter()
    iov_iter.c: handle ITER_KVEC directly
    iov_iter.c: convert copy_to_iter() to iterate_and_advance
    iov_iter.c: convert copy_from_iter() to iterate_and_advance
    iov_iter.c: get rid of bvec_copy_page_{to,from}_iter()
    iov_iter.c: convert iov_iter_zero() to iterate_and_advance
    iov_iter.c: convert iov_iter_get_pages_alloc() to iterate_all_kinds
    iov_iter.c: convert iov_iter_get_pages() to iterate_all_kinds
    iov_iter.c: convert iov_iter_npages() to iterate_all_kinds
    iov_iter.c: iterate_and_advance
    iov_iter.c: macros for iterating over iov_iter
    kill f_dentry macro
    dcache: fix kmemcheck warning in switch_names
    new helper: audit_file()
    nfsd_vfs_write(): use file_inode()
    ncpfs: use file_inode()
    kill f_dentry uses
    lockd: get rid of ->f_path.dentry->d_sb
    ...

    Linus Torvalds
     
  • Pull quota updates from Jan Kara:
    "Quota improvements and some minor cleanups.

    The main portion in the pull request are changes which move i_dquot
    array from struct inode into fs-private part of an inode which saves
    memory for filesystems which don't use VFS quotas"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: One function call less in udf_fill_super() after error detection
    udf: Deletion of unnecessary checks before the function call "iput"
    jbd: Deletion of an unnecessary check before the function call "iput"
    vfs: Remove i_dquot field from inode
    jfs: Convert to private i_dquot field
    reiserfs: Convert to private i_dquot field
    ocfs2: Convert to private i_dquot field
    ext4: Convert to private i_dquot field
    ext3: Convert to private i_dquot field
    ext2: Convert to private i_dquot field
    quota: Use function to provide i_dquot pointers
    xfs: Set allowed quota types
    gfs2: Set allowed quota types
    quota: Allow each filesystem to specify which quota types it supports
    quota: Remove const from function declarations
    quota: Add log level to printk

    Linus Torvalds
     

20 Nov, 2014

9 commits


18 Nov, 2014

1 commit


17 Nov, 2014

1 commit

  • The current gfs2 freezing code is considerably more complicated than it
    should be because it doesn't use the vfs freezing code on any node except
    the one that begins the freeze. This is because it needs to acquire a
    cluster glock before calling the vfs code to prevent a deadlock, and
    without the new freeze_super and thaw_super hooks, that was impossible. To
    deal with the issue, gfs2 had to do some hacky locking tricks to make sure
    that a frozen node couldn't be holding on a lock it needed to do the
    unfreeze ioctl.

    This patch makes use of the new hooks to simply the gfs2 locking code. Now,
    all the nodes in the cluster freeze and thaw in exactly the same way. Every
    node in the cluster caches the freeze glock in the shared state. The new
    freeze_super hook allows the freezing node to grab this freeze glock in
    the exclusive state without first calling the vfs freeze_super function.
    All the nodes in the cluster see this lock change, and call the vfs
    freeze_super function. The vfs locking code guarantees that the nodes can't
    get stuck holding the glocks necessary to unfreeze the system. To
    unfreeze, the freezing node uses the new thaw_super hook to drop the freeze
    glock. Again, all the nodes notice this, reacquire the glock in shared mode
    and call the vfs thaw_super function.

    Signed-off-by: Benjamin Marzinski
    Signed-off-by: Steven Whitehouse

    Benjamin Marzinski
     

14 Nov, 2014

3 commits

  • gfs2_fallocate() wasn't updating ctime and mtime when modifying the
    inode. Add a call to file_update_time() to do that.

    Signed-off-by: Andrew Price
    Signed-off-by: Steven Whitehouse

    Andrew Price
     
  • This addresses an issue caught by fsx where the inode size was not being
    updated to the expected value after fallocate(2) with mode 0.

    The problem was caused by the offset and len parameters being converted
    to multiples of the file system's block size, so i_size would be rounded
    up to the nearest block size multiple instead of the requested size.

    This replaces the per-chunk i_size updates with a single i_size_write on
    successful completion of the operation. With this patch gfs2 gets
    through a complete run of fsx.

    For clarity, the check for (error == 0) following the loop is removed as
    all failures before that point jump to out_* labels or return.

    Signed-off-by: Andrew Price
    Signed-off-by: Steven Whitehouse

    Andrew Price
     
  • gfs2_fallocate wasn't checking inode_newsize_ok nor get_write_access.
    Split out the context setup and inode locking pieces into a separate
    function to make it more clear and add these missing calls.

    inode_newsize_ok is called conditional on FALLOC_FL_KEEP_SIZE as there
    is no need to enforce a file size limit if it isn't going to change.

    Signed-off-by: Andrew Price
    Signed-off-by: Steven Whitehouse

    Andrew Price
     

10 Nov, 2014

1 commit


04 Nov, 2014

4 commits

  • If we run out of blocks for a given multi-block allocation, we obviously
    did not reserve enough. We should reserve more blocks for the next
    reservation to reduce fragmentation. This patch increases the size hint
    for reservations when they run out.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • If an application does a sequence of (1) big write, (2) little write
    we don't necessarily want to reset the size hint based on the smaller
    size. The fact that they did any big writes implies they may do more,
    and therefore we should try to allocate bigger block reservations, even
    if the last few were small writes. Therefore this patch changes function
    gfs2_size_hint so that the size hint can only grow; it cannot shrink.
    This is especially important where there are multiple writers.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • This patch tries to use the journal numbers to evenly distribute
    which node prefers which resource group for block allocations. This
    is to help performance.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • No need to store gfs2_dir_check result and test it before returning.

    Signed-off-by: Fabian Frederick
    Signed-off-by: Steven Whitehouse

    Fabian Frederick
     

01 Nov, 2014

1 commit


13 Oct, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "The big thing in this pile is Eric's unmount-on-rmdir series; we
    finally have everything we need for that. The final piece of prereqs
    is delayed mntput() - now filesystem shutdown always happens on
    shallow stack.

    Other than that, we have several new primitives for iov_iter (Matt
    Wilcox, culled from his XIP-related series) pushing the conversion to
    ->read_iter()/ ->write_iter() a bit more, a bunch of fs/dcache.c
    cleanups and fixes (including the external name refcounting, which
    gives consistent behaviour of d_move() wrt procfs symlinks for long
    and short names alike) and assorted cleanups and fixes all over the
    place.

    This is just the first pile; there's a lot of stuff from various
    people that ought to go in this window. Starting with
    unionmount/overlayfs mess... ;-/"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (60 commits)
    fs/file_table.c: Update alloc_file() comment
    vfs: Deduplicate code shared by xattr system calls operating on paths
    reiserfs: remove pointless forward declaration of struct nameidata
    don't need that forward declaration of struct nameidata in dcache.h anymore
    take dname_external() into fs/dcache.c
    let path_init() failures treated the same way as subsequent link_path_walk()
    fix misuses of f_count() in ppp and netlink
    ncpfs: use list_for_each_entry() for d_subdirs walk
    vfs: move getname() from callers to do_mount()
    gfs2_atomic_open(): skip lookups on hashed dentry
    [infiniband] remove pointless assignments
    gadgetfs: saner API for gadgetfs_create_file()
    f_fs: saner API for ffs_sb_create_file()
    jfs: don't hash direct inode
    [s390] remove pointless assignment of ->f_op in vmlogrdr ->open()
    ecryptfs: ->f_op is never NULL
    android: ->f_op is never NULL
    nouveau: __iomem misannotations
    missing annotation in fs/file.c
    fs: namespace: suppress 'may be used uninitialized' warnings
    ...

    Linus Torvalds
     

12 Oct, 2014

1 commit

  • Pull file locking related changes from Jeff Layton:
    "This release is a little more busy for file locking changes than the
    last:

    - a set of patches from Kinglong Mee to fix the lockowner handling in
    knfsd
    - a pile of cleanups to the internal file lease API. This should get
    us a bit closer to allowing for setlease methods that can block.

    There are some dependencies between mine and Bruce's trees this cycle,
    and I based my tree on top of the requisite patches in Bruce's tree"

    * tag 'locks-v3.18-1' of git://git.samba.org/jlayton/linux: (26 commits)
    locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING
    locks: flock_make_lock should return a struct file_lock (or PTR_ERR)
    locks: set fl_owner for leases to filp instead of current->files
    locks: give lm_break a return value
    locks: __break_lease cleanup in preparation of allowing direct removal of leases
    locks: remove i_have_this_lease check from __break_lease
    locks: move freeing of leases outside of i_lock
    locks: move i_lock acquisition into generic_*_lease handlers
    locks: define a lm_setup handler for leases
    locks: plumb a "priv" pointer into the setlease routines
    nfsd: don't keep a pointer to the lease in nfs4_file
    locks: clean up vfs_setlease kerneldoc comments
    locks: generic_delete_lease doesn't need a file_lock at all
    nfsd: fix potential lease memory leak in nfs4_setlease
    locks: close potential race in lease_get_mtime
    security: make security_file_set_fowner, f_setown and __f_setown void return
    locks: consolidate "nolease" routines
    locks: remove lock_may_read and lock_may_write
    lockd: rip out deferred lock handling from testlock codepath
    NFSD: Get reference of lockowner when coping file_lock
    ...

    Linus Torvalds
     

09 Oct, 2014

2 commits


08 Oct, 2014

1 commit


03 Oct, 2014

1 commit


01 Oct, 2014

1 commit

  • This patch fixes a regression in the patch "GFS2: Remember directory
    insert point", commit 2b47dad866d04f14c328f888ba5406057b8c7d33.
    The problem had to do with the rename function: The function found
    space for the new dirent, and remembered that location. But then the
    old dirent was removed, which often moved the eligible location for
    the renamed dirent. Putting the new dirent at the saved location
    caused file system corruption.

    This patch adds a new "save_loc" variable to struct gfs2_diradd.
    If 1, the dirent location is saved. If 0, the dirent location is not
    saved and the buffer_head is released as per previous behavior.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     

19 Sep, 2014

1 commit

  • This patch checks if i_goal is either zero or if doesn't exist
    within any rgrp (i.e gfs2_blk2rgrpd() returns NULL). If so, it
    assigns the ip->i_no_addr block as the i_goal.

    There are two scenarios where a bad i_goal can result in a
    -EBADSLT error.

    1. Attempting to allocate to an existing inode:
    Control reaches gfs2_inplace_reserve() and ip->i_goal is bad.
    We need to fix i_goal here.

    2. A new inode is created in a directory whose i_goal is hosed:
    In this case, the parent dir's i_goal is copied onto the new
    inode. Since the new inode is not yet created, the ip->i_no_addr
    field is invalid and so, the fix in gfs2_inplace_reserve() as per
    1) won't work in this scenario. We need to catch and fix it sooner
    in the parent dir itself (gfs2_create_inode()), before it is
    copied to the new inode.

    Signed-off-by: Abhi Das
    Signed-off-by: Steven Whitehouse

    Abhi Das
     

13 Sep, 2014

1 commit

  • Callers of d_splice_alias(dentry, inode) don't need iput(), neither
    on success nor on failure. Either the reference to inode is stored
    in a previously negative dentry, or it's dropped. In either case
    inode reference the caller used to hold is consumed.

    __gfs2_lookup() does iput() in case when d_splice_alias() has failed.
    Double iput() if we ever hit that. And gfs2_create_inode() ends up
    not only with double iput(), but with link count dropped to zero - on
    an inode it has just found in directory.

    Cc: stable@vger.kernel.org # v3.14+
    Signed-off-by: Al Viro
    Signed-off-by: Steven Whitehouse

    Al Viro
     

11 Sep, 2014

2 commits

  • MAXQUOTAS value defines maximum number of quota types VFS supports.
    This isn't necessarily the number of types gfs2 supports and with
    addition of project quotas these two numbers stop matching. So make gfs2
    use its private definition.

    CC: cluster-devel@redhat.com
    Signed-off-by: Jan Kara
    Signed-off-by: Steven Whitehouse

    Jan Kara
     
  • Fix a regression introduced by:
    6d4ade986f9c8df31e68 GFS2: Add atomic_open support
    where an early return misses d_splice_alias() which had been
    adding the negative dentry.

    Signed-off-by: Benjamin Coddington
    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Benjamin Coddington
     

10 Sep, 2014

1 commit

  • GFS2 and NFS have setlease routines that always just return -EINVAL.
    Turn that into a generic routine that can live in fs/libfs.c.

    Cc:
    Cc: Steven Whitehouse
    Cc:
    Signed-off-by: Jeff Layton
    Acked-by: Trond Myklebust
    Reviewed-by: Christoph Hellwig

    Jeff Layton
     

21 Aug, 2014

3 commits

  • This patch changes the flock code so that it uses the TRY_1CB flag
    instead of the TRY flag on the first attempt. That forces any holding
    nodes to issue a dlm callback, which requests a demote of the glock.
    Then, if the "try" failed, it sleeps a small amount of time for the
    demote to occur. Then it tries again, for an increasing amount of time.
    Subsequent attempts to gain the "try" lock don't use "_1CB" so that
    only one callback is issued.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • This patch changes some variables (especially maxlen in function
    gfs2_block_map) from unsigned int to size_t. We need 64-bit arithmetic
    for very large files (e.g. 1PB) where the variables otherwise get
    shifted to all 0's.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • fix checkpatch warnings:
    "WARNING: Prefer seq_puts to seq_printf"

    Cc: cluster-devel@redhat.com
    Signed-off-by: Fabian Frederick
    Signed-off-by: Steven Whitehouse

    Fabian Frederick
     

28 Jul, 2014

1 commit


18 Jul, 2014

2 commits