1. 26 Apr, 2016 1 commit
  2. 29 Mar, 2016 1 commit
  3. 13 Mar, 2016 1 commit
  4. 03 Mar, 2016 1 commit
  5. 18 Feb, 2016 2 commits
    • Jan Kara's avatar
      quota: Forbid Q_GETQUOTA and Q_GETNEXTQUOTA for frozen filesystem · ccf370e4
      Jan Kara authored
      Commit 7955118e (quota: Allow Q_GETQUOTA for frozen filesystem)
      allowed Q_GETQUOTA call for frozen filesystem. It makes sense on the
      first look but zero-day testing has shown that with this change ext4
      warns about starting a transaction for frozen filesystem. This happens
      because ext4_acquire_dquot() prepares for allocating space for new quota
      structure. Although it would be possible to implement Q_GETQUOTA for
      ext4 without allocating space for non-existent structures, the matter
      further complicates because OCFS2 needs to update on-disk structure use
      count when a new cluster node loads quota information from disk. So just
      revert the change and forbid Q_GETQUOTA together with Q_GETNEXTQUOTA for
      frozen filesystem. Add comment to quotactl_cmd_write() to save us from
      repeating this excercise in a few years when I forget again.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      ccf370e4
    • Jan Kara's avatar
      quota: Fix possible races during quota loading · 044c9b67
      Jan Kara authored
      When loading new quota structure from disk, there is a possibility caller
      of dqget() will see uninitialized data due to CPU reordering loads or
      stores - loads from dquot can be reordered before test of DQ_ACTIVE_B
      bit or setting of this bit could be reordered before filling of the
      structure. Fix the issue by adding proper memory barriers.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      044c9b67
  6. 09 Feb, 2016 4 commits
  7. 07 Feb, 2016 3 commits
    • Eric Sandeen's avatar
      quota: add new quotactl Q_GETNEXTQUOTA · 926132c0
      Eric Sandeen authored
      Q_GETNEXTQUOTA is exactly like Q_GETQUOTA, except that it
      will return quota information for the id equal to or greater
      than the id requested.  In other words, if the requested id has
      no quota, the command will return quota information for the
      next higher id which does have a quota set.  If no higher id
      has an active quota, -ESRCH is returned.
      
      This allows filesystems to do efficient iteration in kernelspace,
      much like extN filesystems do in userspace when asked to report
      all active quotas.
      
      This does require a new data structure for userspace, as the
      current structure does not include an ID for the returned quota
      information.
      
      Today, Ext4 with a hidden quota inode requires getpwent-style
      iterations, and for systems which have i.e. LDAP backends,
      this can be very slow, or even impossible if iteration is not
      allowed in the configuration.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      926132c0
    • Eric Sandeen's avatar
      quota: add new quotactl Q_XGETNEXTQUOTA · 8b375249
      Eric Sandeen authored
      Q_XGETNEXTQUOTA is exactly like Q_XGETQUOTA, except that it
      will return quota information for the id equal to or greater
      than the id requested.  In other words, if the requested id has
      no quota, the command will return quota information for the
      next higher id which does have a quota set.  If no higher id
      has an active quota, -ESRCH is returned.
      
      This allows filesystems to do efficient iteration in kernelspace,
      much like extN filesystems do in userspace when asked to report
      all active quotas.
      
      The patch adds a d_id field to struct qc_dqblk so that we can
      pass back the id of the quota which was found, and return it
      to userspace.
      
      Today, filesystems such as XFS require getpwent-style iterations,
      and for systems which have i.e. LDAP backends, this can be very
      slow, or even impossible if iteration is not allowed in the
      configuration.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      8b375249
    • Eric Sandeen's avatar
      quota: remove unused cmd argument from quota_quotaon() · 3218a3ec
      Eric Sandeen authored
      The cmd argument to quota_quotaon() via Q_QUOTAON quotactl
      is not used, so remove it.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      3218a3ec
  8. 22 Jan, 2016 1 commit
    • Al Viro's avatar
      wrappers for ->i_mutex access · 5955102c
      Al Viro authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  9. 04 Jan, 2016 1 commit
  10. 14 Dec, 2015 2 commits
    • Paul Gortmaker's avatar
      fs: make quota/dquot.c explicitly non-modular · 331221fa
      Paul Gortmaker authored
      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 <jack@suse.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      331221fa
    • Paul Gortmaker's avatar
      fs: make quota/netlink.c explicitly non-modular · 7da54463
      Paul Gortmaker authored
      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 <jack@suse.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      7da54463
  11. 17 Aug, 2015 1 commit
  12. 11 Aug, 2015 1 commit
  13. 23 Jul, 2015 1 commit
    • Jan Kara's avatar
      quota: Propagate error from ->acquire_dquot() · 6184fc0b
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      6184fc0b
  14. 15 Apr, 2015 1 commit
  15. 18 Mar, 2015 1 commit
  16. 04 Mar, 2015 8 commits
  17. 30 Jan, 2015 5 commits
  18. 28 Jan, 2015 1 commit
    • Jan Kara's avatar
      quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units · 14bf61ff
      Jan Kara authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      14bf61ff
  19. 21 Jan, 2015 3 commits
    • Jan Kara's avatar
      quota: Verify flags passed to Q_SETINFO · ca6cb091
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      ca6cb091
    • Jan Kara's avatar
      quota: Cleanup flags definitions · 9c45101e
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      9c45101e
    • Jan Kara's avatar
      quota: Don't store flags for v2 quota format · c119c5b9
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      c119c5b9
  20. 06 Jan, 2015 1 commit
    • Pranith Kumar's avatar
      rcu: Make SRCU optional by using CONFIG_SRCU · 83fe27ea
      Pranith Kumar authored
      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: default avatarPranith Kumar <bobby.prani@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Josh Triplett <josh@joshtriplett.org>
      CC: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]
      83fe27ea