13 Aug, 2013

1 commit


11 Jul, 2013

1 commit

  • Add project quota changes to all the places where group quota field
    is used:
    * add separate project quota members into various structures
    * split project quota and group quotas so that instead of overriding
    the group quota members incore, the new project quota members are
    used instead
    * get rid of usage of the OQUOTA flag incore, in favor of separate
    group and project quota flags.
    * add a project dquot argument to various functions.

    Not using the pquotino field from superblock yet.

    Signed-off-by: Chandra Seetharaman
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    Chandra Seetharaman
     

10 Jul, 2013

1 commit

  • During review of the separate project quota inode patches, it became
    obvious that the dquot log reservation calculation underestimated
    the number dquots that can be modified in a transaction. This has
    it's roots way back in the Irix quota implementation.

    That is, when quotas were first implemented in XFS, it only
    supported user and project quotas as Irix did not have group quotas.
    Hence the worst case operation involving dquot modification was
    calculated to involve 2 user dquots and 1 project dquot or 1 user
    dequot and 2 project dquots. i.e. 3 dquots. This was determined back
    in 1996, and has remained unchanged ever since.

    However, back in 2001, the Linux XFS port dropped all support for
    project quota and implmented group quotas over the top. This was
    effectively done with a search-and-replace of project with group,
    and as such the log reservation was not changed. However, with the
    advent of group quotas, chmod and rename now could modify more than
    3 dquots in a single transaction - both could modify 4 dquots. Hence
    this log reservation has been wrong for a long time.

    In 2005, project quota support was reintroduced into Linux, but it
    was implemented to be mutually exclusive to group quotas and so this
    didn't add any new changes to the dquot log reservation. Hence when
    project quotas were in use (rather than group quotas) the log
    reservation was again valid, just like in the Irix days.

    Now, with the addition of the separate project quota inode, group
    and project quotas are no longer mutually exclusive, and hence
    operations can now modify three dquots per inode where previously it
    was only two. The worst case here is the rename transaction, which
    can allocate/free space on two different directory inodes, and if
    they have different uid/gid/prid configurations and are world
    writeable, then rename can actually modify 6 different dquots now.

    Further, the dquot log reservation doesn't take into account the
    space used by the dquot log format structure that precedes the dquot
    that is logged, and hence further underestimates the worst case
    log space required by dquots during a transaction. This has been
    missing since the first commit in 1996.

    Hence the worst case log reservation needs to be increased from 3 to
    6, and it needs to take into account a log format header for each of
    those dquots.

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     

29 Jun, 2013

4 commits


23 Mar, 2013

1 commit


18 Jan, 2013

1 commit


18 Sep, 2012

1 commit

  • Modify quota_send_warning to take struct kqid instead a type and
    identifier pair.

    When sending netlink broadcasts always convert uids and quota
    identifiers into the intial user namespace. There is as yet no way to
    send a netlink broadcast message with different contents to receivers
    in different namespaces, so for the time being just map all of the
    identifiers into the initial user namespace which preserves the
    current behavior.

    Change the callers of quota_send_warning in gfs2, xfs and dquot
    to generate a struct kqid to pass to quota send warning. When
    all of the user namespaces convesions are complete a struct kqid
    values will be availbe without need for conversion, but a conversion
    is needed now to avoid needing to convert everything at once.

    Cc: Ben Myers
    Cc: Alex Elder
    Cc: Dave Chinner
    Cc: Jan Kara
    Cc: Steven Whitehouse
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

15 May, 2012

2 commits

  • With the removal of xfs_rw.h and other changes over time, xfs_bit.h
    is being included in many files that don't actually need it. Clean
    up the includes as necessary.

    Also move the only-used-once xfs_ialloc_find_free() static inline
    function out of a header file that is widely included to reduce
    the number of needless dependencies on xfs_bit.h.

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     
  • Untangle the header file includes a bit by moving the definition of
    xfs_agino_t to xfs_types.h. This removes the dependency that xfs_ag.h has on
    xfs_inum.h, meaning we don't need to include xfs_inum.h everywhere we include
    xfs_ag.h.

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     

15 Mar, 2012

1 commit

  • If we initialize the slab caches for the quota code when XFS is loaded there
    is no need for a global and reference counted quota manager structure. Drop
    all this overhead and also fix the error handling during quota initialization.

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

    Christoph Hellwig
     

23 Feb, 2012

1 commit

  • This patch is a cleanup of quota check on disk blocks and inodes
    reservations, and changes it as follows.

    (1) add a total_count variable to store the total number of
    current usages and new reservations for disk blocks and inodes,
    respectively.

    (2) make it more readable to check if the local variables softlimit
    and hardlimit are positive. It has been changed as follows.
    if (softlimit > 0ULL) -> if (softlimit)
    if (hardlimit > 0ULL) -> if (hardlimit)
    This is because they are defined as xfs_qcnt_t which is unsigned.

    Signed-off-by: Mitsuo Hayasaka
    Cc: Ben Myers
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Reviewed-by: Mark Tinguely
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Ben Myers

    Mitsuo Hayasaka
     

22 Feb, 2012

2 commits

  • The xfs checks quota when reserving disk blocks and inodes. In the block
    reservation, it checks if the total number of blocks including current
    usage and new reservation exceed quota. In the inode reservation,
    it checks using the total number of inodes including only current usage
    without new reservation. However, this inode quota check works well
    since the caller of xfs_trans_dquot() always sets the argument of the
    number of new inode reservation to 1 or 0 and inode is reserved one by
    one in current xfs.

    To make it more general, this patch changes it to the same way as the
    block quota check.

    Signed-off-by: Mitsuo Hayasaka
    Cc: Ben Myers
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Reviewed-by: Mark Tinguely
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Ben Myers

    (cherry picked from commit c922bbc819324558e61402a7a76c10c550ca61bc)

    Mitsuo Hayasaka
     
  • In general, quota allows us to use disk blocks and inodes up to each
    limit, that is, they are available if they don't exceed their limitations.
    Current xfs sets their available ranges to lower than them except disk
    inode quota check. So, this patch changes the ranges to not beyond them.

    Signed-off-by: Mitsuo Hayasaka
    Cc: Ben Myers
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    (cherry picked from commit 20f12d8ac01917d96860f352f67eddd912df0afb)

    Mitsuo Hayasaka
     

13 Aug, 2011

1 commit

  • Use the move from Linux 2.6 to Linux 3.x as an excuse to kill the
    annoying subdirectories in the XFS source code. Besides the large
    amount of file rename the only changes are to the Makefile, a few
    files including headers with the subdirectory prefix, and the binary
    sysctl compat code that includes a header under fs/xfs/ from
    kernel/.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig