24 Feb, 2015

2 commits


23 Feb, 2015

4 commits

  • A new fsync vs power fail test in xfstests indicated that XFS can
    have unreliable data consistency when doing extending truncates that
    require block zeroing. The blocks beyond EOF get zeroed in memory,
    but we never force those changes to disk before we run the
    transaction that extends the file size and exposes those blocks to
    userspace. This can result in the blocks not being correctly zeroed
    after a crash.

    Because in-memory behaviour is correct, tools like fsx don't pick up
    any coherency problems - it's not until the filesystem is shutdown
    or the system crashes after writing the truncate transaction to the
    journal but before the zeroed data in the page cache is flushed that
    the issue is exposed.

    Fix this by also flushing the dirty data in memory region between
    the old size and new size when we've found blocks that need zeroing
    in the truncate process.

    Reported-by: Liu Bo
    cc:
    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • For filesystems without separate project quota inode field in the
    superblock we just reuse project quota file for group quotas (and vice
    versa) if project quota file is allocated and we need group quota file.
    When we reuse the file, quota structures on disk suddenly have wrong
    type stored in d_flags though. Nobody really cares about this (although
    structure type reported to userspace was wrong as well) except
    that after commit 14bf61ffe6ac (quota: Switch ->get_dqblk() and
    ->set_dqblk() to use bytes as space units) assertion in
    xfs_qm_scall_getquota() started to trigger on xfs/106 test (apparently I
    was testing without XFS_DEBUG so I didn't notice when submitting the
    above commit).

    Fix the problem by properly resetting ddq->d_flags when running quotacheck
    for a quota file.

    CC: stable@vger.kernel.org
    Reported-by: Al Viro
    Signed-off-by: Jan Kara
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Jan Kara
     
  • Pull more vfs updates from Al Viro:
    "Assorted stuff from this cycle. The big ones here are multilayer
    overlayfs from Miklos and beginning of sorting ->d_inode accesses out
    from David"

    * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (51 commits)
    autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation
    procfs: fix race between symlink removals and traversals
    debugfs: leave freeing a symlink body until inode eviction
    Documentation/filesystems/Locking: ->get_sb() is long gone
    trylock_super(): replacement for grab_super_passive()
    fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
    Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
    VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
    SELinux: Use d_is_positive() rather than testing dentry->d_inode
    Smack: Use d_is_positive() rather than testing dentry->d_inode
    TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
    Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode
    Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb
    VFS: Split DCACHE_FILE_TYPE into regular and special types
    VFS: Add a fallthrough flag for marking virtual dentries
    VFS: Add a whiteout dentry type
    VFS: Introduce inode-getting helpers for layered/unioned fs environments
    Infiniband: Fix potential NULL d_inode dereference
    posix_acl: fix reference leaks in posix_acl_create
    autofs4: Wrong format for printing dentry
    ...

    Linus Torvalds
     
  • Convert the following where appropriate:

    (1) S_ISLNK(dentry->d_inode) to d_is_symlink(dentry).

    (2) S_ISREG(dentry->d_inode) to d_is_reg(dentry).

    (3) S_ISDIR(dentry->d_inode) to d_is_dir(dentry). This is actually more
    complicated than it appears as some calls should be converted to
    d_can_lookup() instead. The difference is whether the directory in
    question is a real dir with a ->lookup op or whether it's a fake dir with
    a ->d_automount op.

    In some circumstances, we can subsume checks for dentry->d_inode not being
    NULL into this, provided we the code isn't in a filesystem that expects
    d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
    use d_inode() rather than d_backing_inode() to get the inode pointer).

    Note that the dentry type field may be set to something other than
    DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
    manages the fall-through from a negative dentry to a lower layer. In such a
    case, the dentry type of the negative union dentry is set to the same as the
    type of the lower dentry.

    However, if you know d_inode is not NULL at the call site, then you can use
    the d_is_xxx() functions even in a filesystem.

    There is one further complication: a 0,0 chardev dentry may be labelled
    DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE. Strictly, this was
    intended for special directory entry types that don't have attached inodes.

    The following perl+coccinelle script was used:

    use strict;

    my @callers;
    open($fd, 'git grep -l \'S_IS[A-Z].*->d_inode\' |') ||
    die "Can't grep for S_ISDIR and co. callers";
    @callers = ;
    close($fd);
    unless (@callers) {
    print "No matches\n";
    exit(0);
    }

    my @cocci = (
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISLNK(E->d_inode->i_mode)',
    '+ d_is_symlink(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISDIR(E->d_inode->i_mode)',
    '+ d_is_dir(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISREG(E->d_inode->i_mode)',
    '+ d_is_reg(E)' );

    my $coccifile = "tmp.sp.cocci";
    open($fd, ">$coccifile") || die $coccifile;
    print($fd "$_\n") || die $coccifile foreach (@cocci);
    close($fd);

    foreach my $file (@callers) {
    chomp $file;
    print "Processing ", $file, "\n";
    system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
    die "spatch failed";
    }

    [AV: overlayfs parts skipped]

    Signed-off-by: David Howells
    Signed-off-by: Al Viro

    David Howells
     

22 Feb, 2015

1 commit

  • …rnel/git/dgc/linux-xfs

    Pull xfs pnfs block layout support from Dave Chinner:
    "This contains the changes to XFS needed to support the PNFS block
    layout server that you pulled in through Bruce's NFS server tree
    merge.

    I originally thought that I'd need to merge changes into the NFS
    server side, but Bruce had already picked them up and so this is
    purely changes to the fs/xfs/ codebase.

    Summary:

    This update contains the implementation of the PNFS server export
    methods that enable use of XFS filesystems as a block layout target"

    * tag 'xfs-pnfs-for-linus-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs:
    xfs: recall pNFS layouts on conflicting access
    xfs: implement pNFS export operations

    Linus Torvalds
     

16 Feb, 2015

2 commits


13 Feb, 2015

5 commits

  • Merge third set of updates from Andrew Morton:

    - the rest of MM

    [ This includes getting rid of the numa hinting bits, in favor of
    just generic protnone logic. Yay. - Linus ]

    - core kernel

    - procfs

    - some of lib/ (lots of lib/ material this time)

    * emailed patches from Andrew Morton : (104 commits)
    lib/lcm.c: replace include
    lib/percpu_ida.c: remove redundant includes
    lib/strncpy_from_user.c: replace module.h include
    lib/stmp_device.c: replace module.h include
    lib/sort.c: move include inside #if 0
    lib/show_mem.c: remove redundant include
    lib/radix-tree.c: change to simpler include
    lib/plist.c: remove redundant include
    lib/nlattr.c: remove redundant include
    lib/kobject_uevent.c: remove redundant include
    lib/llist.c: remove redundant include
    lib/md5.c: simplify include
    lib/list_sort.c: rearrange includes
    lib/genalloc.c: remove redundant include
    lib/idr.c: remove redundant include
    lib/halfmd4.c: simplify includes
    lib/dynamic_queue_limits.c: simplify includes
    lib/sort.c: use simpler includes
    lib/interval_tree.c: simplify includes
    hexdump: make it return number of bytes placed in buffer
    ...

    Linus Torvalds
     
  • Currently, the isolate callback passed to the list_lru_walk family of
    functions is supposed to just delete an item from the list upon returning
    LRU_REMOVED or LRU_REMOVED_RETRY, while nr_items counter is fixed by
    __list_lru_walk_one after the callback returns. Since the callback is
    allowed to drop the lock after removing an item (it has to return
    LRU_REMOVED_RETRY then), the nr_items can be less than the actual number
    of elements on the list even if we check them under the lock. This makes
    it difficult to move items from one list_lru_one to another, which is
    required for per-memcg list_lru reparenting - we can't just splice the
    lists, we have to move entries one by one.

    This patch therefore introduces helpers that must be used by callback
    functions to isolate items instead of raw list_del/list_move. These are
    list_lru_isolate and list_lru_isolate_move. They not only remove the
    entry from the list, but also fix the nr_items counter, making sure
    nr_items always reflects the actual number of elements on the list if
    checked under the appropriate lock.

    Signed-off-by: Vladimir Davydov
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Tejun Heo
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Cc: Dave Chinner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     
  • We are going to make FS shrinkers memcg-aware. To achieve that, we will
    have to pass the memcg to scan to the nr_cached_objects and
    free_cached_objects VFS methods, which currently take only the NUMA node
    to scan. Since the shrink_control structure already holds the node, and
    the memcg to scan will be added to it when we introduce memcg-aware
    vmscan, let us consolidate the methods' arguments in this structure to
    keep things clean.

    Signed-off-by: Vladimir Davydov
    Suggested-by: Dave Chinner
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Greg Thelen
    Cc: Glauber Costa
    Cc: Alexander Viro
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     
  • Kmem accounting of memcg is unusable now, because it lacks slab shrinker
    support. That means when we hit the limit we will get ENOMEM w/o any
    chance to recover. What we should do then is to call shrink_slab, which
    would reclaim old inode/dentry caches from this cgroup. This is what
    this patch set is intended to do.

    Basically, it does two things. First, it introduces the notion of
    per-memcg slab shrinker. A shrinker that wants to reclaim objects per
    cgroup should mark itself as SHRINKER_MEMCG_AWARE. Then it will be
    passed the memory cgroup to scan from in shrink_control->memcg. For
    such shrinkers shrink_slab iterates over the whole cgroup subtree under
    the target cgroup and calls the shrinker for each kmem-active memory
    cgroup.

    Secondly, this patch set makes the list_lru structure per-memcg. It's
    done transparently to list_lru users - everything they have to do is to
    tell list_lru_init that they want memcg-aware list_lru. Then the
    list_lru will automatically distribute objects among per-memcg lists
    basing on which cgroup the object is accounted to. This way to make FS
    shrinkers (icache, dcache) memcg-aware we only need to make them use
    memcg-aware list_lru, and this is what this patch set does.

    As before, this patch set only enables per-memcg kmem reclaim when the
    pressure goes from memory.limit, not from memory.kmem.limit. Handling
    memory.kmem.limit is going to be tricky due to GFP_NOFS allocations, and
    it is still unclear whether we will have this knob in the unified
    hierarchy.

    This patch (of 9):

    NUMA aware slab shrinkers use the list_lru structure to distribute
    objects coming from different NUMA nodes to different lists. Whenever
    such a shrinker needs to count or scan objects from a particular node,
    it issues commands like this:

    count = list_lru_count_node(lru, sc->nid);
    freed = list_lru_walk_node(lru, sc->nid, isolate_func,
    isolate_arg, &sc->nr_to_scan);

    where sc is an instance of the shrink_control structure passed to it
    from vmscan.

    To simplify this, let's add special list_lru functions to be used by
    shrinkers, list_lru_shrink_count() and list_lru_shrink_walk(), which
    consolidate the nid and nr_to_scan arguments in the shrink_control
    structure.

    This will also allow us to avoid patching shrinkers that use list_lru
    when we make shrink_slab() per-memcg - all we will have to do is extend
    the shrink_control structure to include the target memcg and make
    list_lru_shrink_{count,walk} handle this appropriately.

    Signed-off-by: Vladimir Davydov
    Suggested-by: Dave Chinner
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Greg Thelen
    Cc: Glauber Costa
    Cc: Alexander Viro
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     
  • Pull backing device changes from Jens Axboe:
    "This contains a cleanup of how the backing device is handled, in
    preparation for a rework of the life time rules. In this part, the
    most important change is to split the unrelated nommu mmap flags from
    it, but also removing a backing_dev_info pointer from the
    address_space (and inode), and a cleanup of other various minor bits.

    Christoph did all the work here, I just fixed an oops with pages that
    have a swap backing. Arnd fixed a missing export, and Oleg killed the
    lustre backing_dev_info from staging. Last patch was from Al,
    unexporting parts that are now no longer needed outside"

    * 'for-3.20/bdi' of git://git.kernel.dk/linux-block:
    Make super_blocks and sb_lock static
    mtd: export new mtd_mmap_capabilities
    fs: make inode_to_bdi() handle NULL inode
    staging/lustre/llite: get rid of backing_dev_info
    fs: remove default_backing_dev_info
    fs: don't reassign dirty inodes to default_backing_dev_info
    nfs: don't call bdi_unregister
    ceph: remove call to bdi_unregister
    fs: remove mapping->backing_dev_info
    fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info
    nilfs2: set up s_bdi like the generic mount_bdev code
    block_dev: get bdev inode bdi directly from the block device
    block_dev: only write bdev inode on close
    fs: introduce f_op->mmap_capabilities for nommu mmap support
    fs: kill BDI_CAP_SWAP_BACKED
    fs: deduplicate noop_backing_dev_info

    Linus Torvalds
     

11 Feb, 2015

3 commits

  • Merge misc updates from Andrew Morton:
    "Bite-sized chunks this time, to avoid the MTA ratelimiting woes.

    - fs/notify updates

    - ocfs2

    - some of MM"

    That laconic "some MM" is mainly the removal of remap_file_pages(),
    which is a big simplification of the VM, and which gets rid of a *lot*
    of random cruft and special cases because we no longer support the
    non-linear mappings that it used.

    From a user interface perspective, nothing has changed, because the
    remap_file_pages() syscall still exists, it's just done by emulating the
    old behavior by creating a lot of individual small mappings instead of
    one non-linear one.

    The emulation is slower than the old "native" non-linear mappings, but
    nobody really uses or cares about remap_file_pages(), and simplifying
    the VM is a big advantage.

    * emailed patches from Andrew Morton : (78 commits)
    memcg: zap memcg_slab_caches and memcg_slab_mutex
    memcg: zap memcg_name argument of memcg_create_kmem_cache
    memcg: zap __memcg_{charge,uncharge}_slab
    mm/page_alloc.c: place zone_id check before VM_BUG_ON_PAGE check
    mm: hugetlb: fix type of hugetlb_treat_as_movable variable
    mm, hugetlb: remove unnecessary lower bound on sysctl handlers"?
    mm: memory: merge shared-writable dirtying branches in do_wp_page()
    mm: memory: remove ->vm_file check on shared writable vmas
    xtensa: drop _PAGE_FILE and pte_file()-related helpers
    x86: drop _PAGE_FILE and pte_file()-related helpers
    unicore32: drop pte_file()-related helpers
    um: drop _PAGE_FILE and pte_file()-related helpers
    tile: drop pte_file()-related helpers
    sparc: drop pte_file()-related helpers
    sh: drop _PAGE_FILE and pte_file()-related helpers
    score: drop _PAGE_FILE and pte_file()-related helpers
    s390: drop pte_file()-related helpers
    parisc: drop _PAGE_FILE and pte_file()-related helpers
    openrisc: drop _PAGE_FILE and pte_file()-related helpers
    nios2: drop _PAGE_FILE and pte_file()-related helpers
    ...

    Linus Torvalds
     
  • Pull xfs update from Dave Chinner:
    "This update contains:

    - RENAME_EXCHANGE support

    - Rework of the superblock logging infrastructure

    - Rework of the XFS_IOCTL_SETXATTR implementation
    * enables use inside user namespaces
    * fixes inconsistencies setting extent size hints

    - fixes for missing buffer type annotations used in log recovery

    - more consolidation of libxfs headers

    - preparation patches for block based PNFS support

    - miscellaneous bug fixes and cleanups"

    * tag 'xfs-for-linus-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs: (37 commits)
    xfs: only trace buffer items if they exist
    xfs: report proper f_files in statfs if we overshoot imaxpct
    xfs: fix panic_mask documentation
    xfs: xfs_ioctl_setattr_check_projid can be static
    xfs: growfs should use synchronous transactions
    xfs: fix behaviour of XFS_IOC_FSSETXATTR on directories
    xfs: factor projid hint checking out of xfs_ioctl_setattr
    xfs: factor extsize hint checking out of xfs_ioctl_setattr
    xfs: XFS_IOCTL_SETXATTR can run in user namespaces
    xfs: kill xfs_ioctl_setattr behaviour mask
    xfs: disaggregate xfs_ioctl_setattr
    xfs: factor out xfs_ioctl_setattr transaciton preamble
    xfs: separate xflags from xfs_ioctl_setattr
    xfs: FSX_NONBLOCK is not used
    xfs: don't allocate an ioend for direct I/O completions
    xfs: change kmem_free to use generic kvfree()
    xfs: factor out a xfs_update_prealloc_flags() helper
    xfs: remove incorrect error negation in attr_multi ioctl
    xfs: set superblock buffer type correctly
    xfs: set buf types when converting extent formats
    ...

    Linus Torvalds
     
  • Nobody uses it anymore.

    [akpm@linux-foundation.org: fix filemap_xip.c]
    Signed-off-by: Kirill A. Shutemov
    Cc: Wu Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

10 Feb, 2015

2 commits

  • Dave Chinner
     
  • The commit 2d3d0c5 ("xfs: lobotomise xfs_trans_read_buf_map()") left
    a landmine in the tracing code: trace_xfs_trans_buf_read() is now
    call on all buffers that are read through this interface rather than
    just buffers in transactions. For buffers outside transaction
    context, bp->b_fspriv is null, and so the buf log item tracing
    functions cannot be called. This causes a NULL pointer dereference
    in the trace_xfs_trans_buf_read() function when tracing is turned
    on.

    cc:
    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     

06 Feb, 2015

1 commit

  • Normally, a statfs syscall reports m_maxicount as f_files
    (total file nodes in file system) because it is supposed
    to be the upper limit for dynamically-allocated inodes.

    It's possible, however, to overshoot imaxpct / m_maxicount.
    If this happens, we should report the actual number of allocated
    inodes, which is contained in sb_icount. Add one more adjustment
    to the statfs code to make this happen.

    Reported-by: Alexander Tsvetkov
    Signed-off-by: Eric Sandeen
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Eric Sandeen
     

05 Feb, 2015

2 commits

  • fs/xfs/xfs_ioctl.c:1146:1: sparse: symbol 'xfs_ioctl_setattr_check_projid' was not declared. Should it be static?

    Also fix xfs_ioctl_setattr_check_extsize at the same time.

    Signed-off-by: Fengguang Wu
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    kbuild test robot
     
  • Growfs updates the secondary superblocks using synchronous unlogged
    buffer writes after committing the updates to the primary superblock.

    Mark the transaction to the primary superblock as synchronous so that
    we guarantee it is committed to disk before we update the secondary
    superblocks.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     

02 Feb, 2015

14 commits

  • Dave Chinner
     
  • Currently, the ioctl handling code for XFS_IOC_FSSETXATTR treats all
    targets as regular files: it refuses to change the extent size if
    extents are allocated. This is wrong for directories, as there the
    extent size is only used as a default for children.

    The patch fixes this issue and improves validation of flag
    combinations:

    - only disallow extent size changes after extents have been allocated
    for regular files
    - only allow XFS_XFLAG_EXTSIZE for regular files
    - only allow XFS_XFLAG_EXTSZINHERIT for directories
    - automatically clear the flags if the extent size is zero

    Thanks to Dave Chinner for guidance on the proper fix for this issue.

    [dchinner: ported changes onto cleanup series. Makes changes clear
    and obvious.]
    [dchinner: added comments documenting validity checking rules.]

    Signed-off-by: Iustin Pop
    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Iustin Pop
     
  • The project ID change checking is one of the few remaining open
    coded checks in xfs_ioctl_setattr(). Factor it into a helper
    function so that the setattr code mostly becomes a flow of check
    and action helpers, making it easier to read and follow.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • The extent size hint change checking is fairly complex, so isolate
    that into it's own function. This simplifies the logic flow of the
    setattr code, making it easier to read.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • Currently XFS_IOCTL_SETXATTR will fail if run in a user namespace as
    it it not allowed to change project IDs. The current code, however,
    also prevents any other change being made as well, so things like
    extent size hints cannot be set in user namespaces. This is wrong,
    so only disallow access to project IDs and related flags from inside
    the init namespace.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • Now there is only one caller to xfs_ioctl_setattr that uses all the
    functionality of the function we can kill the behviour mask and
    start cleaning up the code.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • xfs_ioctl_setxflags doesn't need all of the functionailty in
    xfs_ioctl_setattr() and now we have separate helper functions that
    share the checks and modifications that xfs_ioctl_setxflags
    requires. Hence disaggregate it from xfs_ioctl_setattr() to allow
    further work to be done on xfs_ioctl_setattr.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • The setup of the transaction is done after a random smattering of
    checks and before another bunch of ioperations specific
    validity checks. Pull all the preamble out into a helper function
    that returns a transaction or error.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • The setting of the extended flags is down through two separate
    interfaces, but they are munged together into xfs_ioctl_setattr
    and make that function far more complex than it needs to be.
    Separate it out into a helper function along with all the other
    common inode changes and transaction manipulations in
    xfs_ioctl_setattr().

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • It is set if the filp is set ot non-blocking, but the flag is not
    used anywhere. Hence we can kill it.

    Signed-off-by: Dave Chinner
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Dave Chinner
     
  • Dave Chinner
     
  • Back in the days when the direct I/O ->end_io callback could be called
    from interrupt context for AIO we needed a structure to hand off to the
    workqueue, and reused the ioend structure for this purpose. These days
    ->end_io is always called from user or workqueue context, which allows us
    to avoid this memory allocation and simplify the code significantly.

    [dchinner: removed now unused xfs_finish_ioend_sync() function after
    Brian Foster did an initial review. ]

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Change kmem_free to use kvfree() generic function, remove the
    duplicated code.

    Signed-off-by: Yalin Wang
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Wang, Yalin
     
  • This logic is duplicated in xfs_file_fallocate and xfs_ioc_space, and
    we'll need another copy of it for pNFS block support.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     

30 Jan, 2015

2 commits


28 Jan, 2015

1 commit

  • Currently ->get_dqblk() and ->set_dqblk() use struct fs_disk_quota which
    tracks space limits and usage in 512-byte blocks. However VFS quotas
    track usage in bytes (as some filesystems require that) and we need to
    somehow pass this information. Upto now it wasn't a problem because we
    didn't do any unit conversion (thus VFS quota routines happily stuck
    number of bytes into d_bcount field of struct fd_disk_quota). Only if
    you tried to use Q_XGETQUOTA or Q_XSETQLIM for VFS quotas (or Q_GETQUOTA
    / Q_SETQUOTA for XFS quotas), you got bogus results. Hardly anyone
    tried this but reportedly some Samba users hit the problem in practice.
    So when we want interfaces compatible we need to fix this.

    We bite the bullet and define another quota structure used for passing
    information from/to ->get_dqblk()/->set_dqblk. It's somewhat sad we have
    to have more conversion routines in fs/quota/quota.c and another copying
    of quota structure slows down getting of quota information by about 2%
    but it seems cleaner than overloading e.g. units of d_bcount to bytes.

    CC: stable@vger.kernel.org
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     

22 Jan, 2015

1 commit

  • xfs_compat_attrmulti_by_handle() calls memdup_user() which returns a
    negative error code. The error code is negated by the caller and thus
    incorrectly converted to a positive error code.

    Remove the error negation such that the negative error is passed
    correctly back up to userspace.

    Signed-off-by: Brian Foster
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Brian Foster