1. 13 12月, 2012 1 次提交
  2. 13 10月, 2012 1 次提交
    • J
      vfs: define struct filename and have getname() return it · 91a27b2a
      Jeff Layton 提交于
      getname() is intended to copy pathname strings from userspace into a
      kernel buffer. The result is just a string in kernel space. It would
      however be quite helpful to be able to attach some ancillary info to
      the string.
      
      For instance, we could attach some audit-related info to reduce the
      amount of audit-related processing needed. When auditing is enabled,
      we could also call getname() on the string more than once and not
      need to recopy it from userspace.
      
      This patchset converts the getname()/putname() interfaces to return
      a struct instead of a string. For now, the struct just tracks the
      string in kernel space and the original userland pointer for it.
      
      Later, we'll add other information to the struct as it becomes
      convenient.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      91a27b2a
  3. 18 9月, 2012 1 次提交
    • E
      userns: Convert qutoactl · 74a8a103
      Eric W. Biederman 提交于
      Update the quotactl user space interface to successfull compile with
      user namespaces support enabled and to hand off quota identifiers to
      lower layers of the kernel in struct kqid instead of type and qid
      pairs.
      
      The quota on function is not converted because while it takes a quota
      type and an id.  The id is the on disk quota format to use, which
      is something completely different.
      
      The signature of two struct quotactl_ops methods were changed to take
      struct kqid argumetns get_dqblk and set_dqblk.
      
      The dquot, xfs, and ocfs2 implementations of get_dqblk and set_dqblk
      are minimally changed so that the code continues to work with
      the change in parameter type.
      
      This is the first in a series of changes to always store quota
      identifiers in the kernel in struct kqid and only use raw type and qid
      values when interacting with on disk structures or userspace.  Always
      using struct kqid internally makes it hard to miss places that need
      conversion to or from the kernel internal values.
      
      Cc: Jan Kara <jack@suse.cz>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Ben Myers <bpm@sgi.com>
      Cc: Alex Elder <elder@kernel.org>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      74a8a103
  4. 23 7月, 2012 1 次提交
  5. 09 7月, 2012 1 次提交
  6. 01 3月, 2012 1 次提交
  7. 14 2月, 2012 1 次提交
    • J
      quota: Fix deadlock with suspend and quotas · dcdbed85
      Jan Kara 提交于
      This script causes a kernel deadlock:
      set -e
      DEVICE=/dev/vg1/linear
      lvchange -ay $DEVICE
      mkfs.ext3 $DEVICE
      mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
      quotacheck -gu /mnt/test
      umount /mnt/test
      mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
      quotaon /mnt/test
      dmsetup suspend $DEVICE
      setquota -u root 1 2 3 4 /mnt/test &
      sleep 1
      dmsetup resume $DEVICE
      
      setquota acquired semaphore s_umount for read and then tried to perform a
      transaction (and waits because the device is suspended).  dmsetup resume tries
      to acquire s_umount for write before resuming the device (and waits for
      setquota).
      
      Fix the deadlock by grabbing a thawed superblock for quota commands which need
      it.
      Reported-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      dcdbed85
  8. 04 1月, 2012 1 次提交
  9. 01 11月, 2011 1 次提交
  10. 31 10月, 2011 1 次提交
    • C
      writeback: Add a 'reason' to wb_writeback_work · 0e175a18
      Curt Wohlgemuth 提交于
      This creates a new 'reason' field in a wb_writeback_work
      structure, which unambiguously identifies who initiates
      writeback activity.  A 'wb_reason' enumeration has been
      added to writeback.h, to enumerate the possible reasons.
      
      The 'writeback_work_class' and tracepoint event class and
      'writeback_queue_io' tracepoints are updated to include the
      symbolic 'reason' in all trace events.
      
      And the 'writeback_inodes_sbXXX' family of routines has had
      a wb_stats parameter added to them, so callers can specify
      why writeback is being started.
      Acked-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      0e175a18
  11. 27 9月, 2011 1 次提交
  12. 13 1月, 2011 1 次提交
    • J
      quota: Fix deadlock during path resolution · f00c9e44
      Jan Kara 提交于
      As Al Viro pointed out path resolution during Q_QUOTAON calls to quotactl
      is prone to deadlocks. We hold s_umount semaphore for reading during the
      path resolution and resolution itself may need to acquire the semaphore
      for writing when e. g. autofs mountpoint is passed.
      
      Solve the problem by performing the resolution before we get hold of the
      superblock (and thus s_umount semaphore). The whole thing is complicated
      by the fact that some filesystems (OCFS2) ignore the path argument. So to
      distinguish between filesystem which want the path and which do not we
      introduce new .quota_on_meta callback which does not get the path. OCFS2
      then uses this callback instead of old .quota_on.
      
      CC: Al Viro <viro@ZenIV.linux.org.uk>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Ted Ts'o <tytso@mit.edu>
      CC: Joel Becker <joel.becker@oracle.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      f00c9e44
  13. 24 5月, 2010 1 次提交
  14. 22 5月, 2010 7 次提交
  15. 05 3月, 2010 9 次提交
  16. 03 12月, 2009 1 次提交
    • S
      VFS: Export dquot_send_warning · 86e931a3
      Steven Whitehouse 提交于
      Sending a message to userspace in a generic format to warn
      of events (e.g. quota exceeded) in the quota subsystem is
      a generically useful feature. This patch makes some minor
      changes to the send_message function from dquot.c renaming
      it quota_send_message, moving it to quota.c and exporting it
      for use by filesystems which do not use the dquot code.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      86e931a3
  17. 12 6月, 2009 1 次提交
    • C
      quota: cleanup dquota sync functions (version 4) · 850b201b
      Christoph Hellwig 提交于
      Currently the VFS calls vfs_dq_sync to sync out disk quotas for a given
      superblock.  This is a small wrapper around sync_dquots which for the
      case of a non-NULL superblock is a small wrapper around quota_sync_sb.
      
      Just make quota_sync_sb global (rename it to sync_quota_sb) and call it
      directly.  Also call it directly for those cases in quota.c that have a
      superblock and leave sync_dquots purely an iterator over sync_quota_sb and
      remove it's superblock argument.
      
      To make this nicer move the check for the lack of a quota_sync method
      from the callers into sync_quota_sb.
      
      [folded build fix from Alexander Beregalov <a.beregalov@gmail.com>]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      850b201b
  18. 26 3月, 2009 3 次提交
  19. 14 1月, 2009 1 次提交
  20. 06 1月, 2009 2 次提交
    • J
      quota: Introduce DQUOT_QUOTA_SYS_FILE flag · ca785ec6
      Jan Kara 提交于
      If filesystem can handle quota files as system files hidden from users, we can
      skip a lot of cache invalidation, syncing, inode flags setting etc. when
      turning quotas on, off and quota_sync. Allow filesystem to indicate that it is
      hiding quota files from users by DQUOT_QUOTA_SYS_FILE flag.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      ca785ec6
    • J
      quota: Allow to separately enable quota accounting and enforcing limits · f55abc0f
      Jan Kara 提交于
      Split DQUOT_USR_ENABLED (and DQUOT_GRP_ENABLED) into DQUOT_USR_USAGE_ENABLED
      and DQUOT_USR_LIMITS_ENABLED. This way we are able to separately enable /
      disable whether we should:
      1) ignore quotas completely
      2) just keep uptodate information about usage
      3) actually enforce quota limits
      
      This is going to be useful when quota is treated as filesystem metadata - we
      then want to keep quota information uptodate all the time and just enable /
      disable limits enforcement.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      f55abc0f
  21. 14 11月, 2008 1 次提交
  22. 26 7月, 2008 1 次提交
  23. 28 4月, 2008 1 次提交