23 Jan, 2016

1 commit

  • parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
    inode_foo(inode) being mutex_foo(&inode->i_mutex).

    Please, use those for access to ->i_mutex; over the coming cycle
    ->i_mutex will become rwsem, with ->lookup() done with it held
    only shared.

    Signed-off-by: Al Viro

    Al Viro
     

04 Jan, 2016

1 commit


14 Dec, 2015

2 commits

  • The Kconfig currently controlling compilation of this code is:

    config QUOTA
    bool "Quota support"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modularity so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering gets bumped to one level earlier when we
    use the more appropriate fs_initcall here. However we've made similar
    changes before without any fallout and none is expected here either.

    We don't delete module.h because the code in turn tries to load other
    modules as appropriate and so it still needs that header.

    Cc: Jan Kara
    Cc: Alexander Viro
    Cc: linux-fsdevel@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Jan Kara

    Paul Gortmaker
     
  • The Kconfig currently controlling compilation of this code is:

    config QUOTA_NETLINK_INTERFACE
    bool "Report quota messages through netlink interface"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modularity so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering gets bumped to one level earlier when we
    use the more appropriate fs_initcall here. However we've made similar
    changes before without any fallout and none is expected here either.

    Cc: Jan Kara
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Jan Kara

    Paul Gortmaker
     

06 Sep, 2015

1 commit

  • Pull vfs updates from Al Viro:
    "In this one:

    - d_move fixes (Eric Biederman)

    - UFS fixes (me; locking is mostly sane now, a bunch of bugs in error
    handling ought to be fixed)

    - switch of sb_writers to percpu rwsem (Oleg Nesterov)

    - superblock scalability (Josef Bacik and Dave Chinner)

    - swapon(2) race fix (Hugh Dickins)"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (65 commits)
    vfs: Test for and handle paths that are unreachable from their mnt_root
    dcache: Reduce the scope of i_lock in d_splice_alias
    dcache: Handle escaped paths in prepend_path
    mm: fix potential data race in SyS_swapon
    inode: don't softlockup when evicting inodes
    inode: rename i_wb_list to i_io_list
    sync: serialise per-superblock sync operations
    inode: convert inode_sb_list_lock to per-sb
    inode: add hlist_fake to avoid the inode hash lock in evict
    writeback: plug writeback at a high level
    change sb_writers to use percpu_rw_semaphore
    shift percpu_counter_destroy() into destroy_super_work()
    percpu-rwsem: kill CONFIG_PERCPU_RWSEM
    percpu-rwsem: introduce percpu_rwsem_release() and percpu_rwsem_acquire()
    percpu-rwsem: introduce percpu_down_read_trylock()
    document rwsem_release() in sb_wait_write()
    fix the broken lockdep logic in __sb_start_write()
    introduce __sb_writers_{acquired,release}() helpers
    ufs_inode_get{frag,block}(): get rid of 'phys' argument
    ufs_getfrag_block(): tidy up a bit
    ...

    Linus Torvalds
     

18 Aug, 2015

1 commit

  • The process of reducing contention on per-superblock inode lists
    starts with moving the locking to match the per-superblock inode
    list. This takes the global lock out of the picture and reduces the
    contention problems to within a single filesystem. This doesn't get
    rid of contention as the locks still have global CPU scope, but it
    does isolate operations on different superblocks form each other.

    Signed-off-by: Dave Chinner
    Signed-off-by: Josef Bacik
    Reviewed-by: Jan Kara
    Reviewed-by: Christoph Hellwig
    Tested-by: Dave Chinner

    Dave Chinner
     

11 Aug, 2015

1 commit


24 Jul, 2015

1 commit

  • Currently when some error happened in ->acquire_dquot(), dqget() just
    returned NULL. That was indistinguishable from a case when e.g. someone
    run quotaoff and so was generally silently ignored. However
    ->acquire_dquot() can fail because of ENOSPC or EIO in which case user
    should better know. So propagate error up from ->acquire_dquot properly.

    Signed-off-by: Jan Kara

    Jan Kara
     

27 Apr, 2015

1 commit

  • Pull fourth vfs update from Al Viro:
    "d_inode() annotations from David Howells (sat in for-next since before
    the beginning of merge window) + four assorted fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    RCU pathwalk breakage when running into a symlink overmounting something
    fix I_DIO_WAKEUP definition
    direct-io: only inc/dec inode->i_dio_count for file systems
    fs/9p: fix readdir()
    VFS: assorted d_backing_inode() annotations
    VFS: fs/inode.c helpers: d_inode() annotations
    VFS: fs/cachefiles: d_backing_inode() annotations
    VFS: fs library helpers: d_inode() annotations
    VFS: assorted weird filesystems: d_inode() annotations
    VFS: normal filesystems (and lustre): d_inode() annotations
    VFS: security/: d_inode() annotations
    VFS: security/: d_backing_inode() annotations
    VFS: net/: d_inode() annotations
    VFS: net/unix: d_backing_inode() annotations
    VFS: kernel/: d_inode() annotations
    VFS: audit: d_backing_inode() annotations
    VFS: Fix up some ->d_inode accesses in the chelsio driver
    VFS: Cachefiles should perform fs modifications on the top layer only
    VFS: AF_UNIX sockets should call mknod on the top layer only

    Linus Torvalds
     

16 Apr, 2015

1 commit


19 Mar, 2015

1 commit


16 Mar, 2015

1 commit


04 Mar, 2015

8 commits

  • Currently quota format that supports 64-bit usage sets maximum quota
    limit as 2^64-1. However quota core code uses signed numbers to track
    usage and even limits themselves are stored in long long. Checking of
    maximum allowable limits worked by luck until commit 14bf61ffe6ac
    (quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space
    units) because variable we compared with was unsigned. After that commit
    the type we compared against changed to signed and thus checks for
    maximum limits with the newest VFS quota format started to refuse any
    non-negative value. Later the problem was inadvertedly fixed by commit
    b10a08194c2b (quota: Store maximum space limit in bytes) because we
    started to compare against unsigned type as well.

    Fix possible future problems of this kind by setting maximum limits to
    2^63-1 to avoid overflow issues.

    Reported-by: Carlos Carvalho
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Root level in quota tree must be already allocated otherwise this block
    could be used for something else.

    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Jan Kara

    Konstantin Khlebnikov
     
  • Remove redundant calls of i_dquot(), keep pointer in local variable.

    add/remove: 0/0 grow/shrink: 3/7 up/down: 40/-278 (-238)
    function old new delta
    __dquot_free_space 734 750 +16
    __dquot_alloc_space 484 500 +16
    dquot_free_inode 324 332 +8
    dquot_drop 82 69 -13
    vfs_load_quota_inode 1357 1341 -16
    dquot_reclaim_space_nodirty 348 316 -32
    dquot_disable 1980 1944 -36
    dquot_claim_space_nodirty 354 314 -40
    __dquot_drop 125 83 -42
    __dquot_initialize 522 423 -99

    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Jan Kara

    Konstantin Khlebnikov
     
  • Setting timers or warning counts for id 0 via Q_XSETQLIM is used to
    actually set time limits and warning limits for all users. Hook up
    ->set_info to this so that VFS quota time limits get set the same
    way as XFS ones.

    When doing this Q_XSETQLIM for XFS is effectively split into two
    independent transactions - one for setting timers and warning limits and
    one for setting space and inode limits. Although this is inefficient, it
    is rare enough that it does not matter.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Change ->set_info to take new qc_info structure which contains all the
    necessary information both for XFS and VFS. Convert Q_SETINFO handler
    to use this structure.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • These callbacks are now unused. Remove them.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Add appropriate conversion functions so that filesystems supporting
    ->get_state() method can be queried using Q_GETXSTATE and Q_GETXSTATV
    calls.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Create new internal interface for getting information about quota which
    contains everything needed for both VFS quotas and XFS quotas. Make VFS
    use this and hook it up to Q_GETINFO.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     

11 Feb, 2015

1 commit

  • Pull quota interface unification and misc cleanups from Jan Kara:
    "The first part of the series unifying XFS and VFS quota interfaces.

    This part unifies turning quotas on and off so quota-tools and
    xfs_quota can be used to manage any filesystem. This is useful so
    that userspace doesn't have to distinguish which filesystem it is
    working with. As a result we can then easily reuse tests for project
    quotas in XFS for ext4.

    This also contains minor cleanups and fixes for udf, isofs, and ext3"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (23 commits)
    udf: remove bool assignment to 0/1
    udf: use bool for done
    quota: Store maximum space limit in bytes
    quota: Remove quota_on_meta callback
    ocfs2: Use generic helpers for quotaon and quotaoff
    ext4: Use generic helpers for quotaon and quotaoff
    quota: Add ->quota_{enable,disable} callbacks for VFS quotas
    quota: Wire up ->quota_{enable,disable} callbacks into Q_QUOTA{ON,OFF}
    quota: Split ->set_xstate callback into two
    xfs: Remove some pointless quota checks
    xfs: Remove some useless flags tests
    xfs: Remove useless test
    quota: Verify flags passed to Q_SETINFO
    quota: Cleanup flags definitions
    ocfs2: Move OLQF_CLEAN flag out of generic quota flags
    quota: Don't store flags for v2 quota format
    jbd: drop jbd_ENOSYS debug
    udf: destroy sbi mutex in put_super
    udf: Check length of extended attributes and allocation descriptors
    udf: Remove repeated loads blocksize
    ...

    Linus Torvalds
     

10 Feb, 2015

1 commit

  • Pull RCU updates from Ingo Molnar:
    "The main RCU changes in this cycle are:

    - Documentation updates.

    - Miscellaneous fixes.

    - Preemptible-RCU fixes, including fixing an old bug in the
    interaction of RCU priority boosting and CPU hotplug.

    - SRCU updates.

    - RCU CPU stall-warning updates.

    - RCU torture-test updates"

    * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits)
    rcu: Initialize tiny RCU stall-warning timeouts at boot
    rcu: Fix RCU CPU stall detection in tiny implementation
    rcu: Add GP-kthread-starvation checks to CPU stall warnings
    rcu: Make cond_resched_rcu_qs() apply to normal RCU flavors
    rcu: Optionally run grace-period kthreads at real-time priority
    ksoftirqd: Use new cond_resched_rcu_qs() function
    ksoftirqd: Enable IRQs and call cond_resched() before poking RCU
    rcutorture: Add more diagnostics in rcu_barrier() test failure case
    torture: Flag console.log file to prevent holdovers from earlier runs
    torture: Add "-enable-kvm -soundhw pcspk" to qemu command line
    rcutorture: Handle different mpstat versions
    rcutorture: Check from beginning to end of grace period
    rcu: Remove redundant rcu_batches_completed() declaration
    rcutorture: Drop rcu_torture_completed() and friends
    rcu: Provide rcu_batches_completed_sched() for TINY_RCU
    rcutorture: Use unsigned for Reader Batch computations
    rcutorture: Make build-output parsing correctly flag RCU's warnings
    rcu: Make _batches_completed() functions return unsigned long
    rcutorture: Issue warnings on close calls due to Reader Batch blows
    documentation: Fix smp typo in memory-barriers.txt
    ...

    Linus Torvalds
     

30 Jan, 2015

6 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

3 commits

  • Currently flags passed via Q_SETINFO were just stored. This makes it
    hard to add new flags since in theory userspace could be just setting /
    clearing random flags. Since currently there is only one userspace
    settable flag and that is somewhat obscure flags only for ancient v1
    quota format, I'm reasonably sure noone operates these flags and
    hopefully we are fine just adding the check that passed flags are sane.
    If we indeed find some userspace program that gets broken by the strict
    check, we can always remove it again.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Currently all quota flags were defined just in kernel-private headers.
    Export flags readable / writeable from userspace to userspace via
    include/uapi/linux/quota.h.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Currently, v2 quota format blindly stored flags from in-memory dqinfo on
    disk, although there are no flags supported. Since it is stupid to store
    flags which have no effect, just store 0 unconditionally and don't
    bother loading it from disk.

    Note that userspace could have stored some flags there via Q_SETINFO
    quotactl and then later read them (although flags have no effect) but
    I'm pretty sure noone does that (most definitely quota-tools don't and
    quota interface doesn't have too much other users).

    Signed-off-by: Jan Kara

    Jan Kara
     

07 Jan, 2015

1 commit

  • SRCU is not necessary to be compiled by default in all cases. For tinification
    efforts not compiling SRCU unless necessary is desirable.

    The current patch tries to make compiling SRCU optional by introducing a new
    Kconfig option CONFIG_SRCU which is selected when any of the components making
    use of SRCU are selected.

    If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.

    text data bss dec hex filename
    2007 0 0 2007 7d7 kernel/rcu/srcu.o

    Size of arch/powerpc/boot/zImage changes from

    text data bss dec hex filename
    831552 64180 23944 919676 e087c arch/powerpc/boot/zImage : before
    829504 64180 23952 917636 e0084 arch/powerpc/boot/zImage : after

    so the savings are about ~2000 bytes.

    Signed-off-by: Pranith Kumar
    CC: Paul E. McKenney
    CC: Josh Triplett
    CC: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]

    Pranith Kumar
     

10 Nov, 2014

4 commits

  • All filesystems using VFS quotas are now converted to use their private
    i_dquot fields. Remove the i_dquot field from generic inode structure.

    Acked-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • i_dquot array is used by relatively few filesystems (ext?, ocfs2, jfs,
    reiserfs) so it is beneficial to move this array to fs-private part of
    the inode. We cannot just pass quota pointers from filesystems to quota
    functions because during quotaon and quotaoff we have to traverse list
    of all inodes and manipulate i_dquot pointers for each inode. So we
    provide a function which generic quota code can use to get pointer to
    the i_dquot array from the filesystem.

    Acked-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Currently all filesystems supporting VFS quota support user and group
    quotas. With introduction of project quotas this is going to change so
    make sure filesystem isn't called for quota type it doesn't support by
    introduction of a bitmask determining which quota types each filesystem
    supports.

    Acked-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     
  • We don't use const through VFS too much so just remove it from quota
    function declarations.

    Signed-off-by: Jan Kara

    Jan Kara
     

04 Nov, 2014

1 commit


22 Oct, 2014

1 commit


08 Sep, 2014

1 commit

  • Percpu allocator now supports allocation mask. Add @gfp to
    percpu_counter_init() so that !GFP_KERNEL allocation masks can be used
    with percpu_counters too.

    We could have left percpu_counter_init() alone and added
    percpu_counter_init_gfp(); however, the number of users isn't that
    high and introducing _gfp variants to all percpu data structures would
    be quite ugly, so let's just do the conversion. This is the one with
    the most users. Other percpu data structures are a lot easier to
    convert.

    This patch doesn't make any functional difference.

    Signed-off-by: Tejun Heo
    Acked-by: Jan Kara
    Acked-by: "David S. Miller"
    Cc: x86@kernel.org
    Cc: Jens Axboe
    Cc: "Theodore Ts'o"
    Cc: Alexander Viro
    Cc: Andrew Morton

    Tejun Heo