27 Sep, 2017

1 commit

  • Eric has reported that since commit d2faa415166b "quota: Do not acquire
    dqio_sem for dquot overwrites in v2 format" test generic/232
    occasionally fails due to quota information being incorrect. Indeed that
    commit was too eager to remove dqio_sem completely from the path that
    just overwrites quota structure with updated information. Although that
    is innocent on its own, another process that inserts new quota structure
    to the same block can perform read-modify-write cycle of that block thus
    effectively discarding quota information update if they race in a wrong
    way.

    Fix the problem by acquiring dqio_sem for reading for overwrites of
    quota structure. Note that it *is* possible to completely avoid taking
    dqio_sem in the overwrite path however that will require modifying path
    inserting / deleting quota structures to avoid RMW cycles of the full
    block and for now it is not clear whether it is worth the hassle.

    Fixes: d2faa415166b2883428efa92f451774ef44373ac
    Reported-and-tested-by: Eric Whitney
    Signed-off-by: Jan Kara

    Jan Kara
     

08 Sep, 2017

1 commit

  • Pull quota scaling updates from Jan Kara:
    "This contains changes to make the quota subsystem more scalable.

    Reportedly it improves number of files created per second on ext4
    filesystem on fast storage by about a factor of 2x"

    * 'quota_scaling' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (28 commits)
    quota: Add lock annotations to struct members
    quota: Reduce contention on dq_data_lock
    fs: Provide __inode_get_bytes()
    quota: Inline dquot_[re]claim_reserved_space() into callsite
    quota: Inline inode_{incr,decr}_space() into callsites
    quota: Inline functions into their callsites
    ext4: Disable dirty list tracking of dquots when journalling quotas
    quota: Allow disabling tracking of dirty dquots in a list
    quota: Remove dq_wait_unused from dquot
    quota: Move locking into clear_dquot_dirty()
    quota: Do not dirty bad dquots
    quota: Fix possible corruption of dqi_flags
    quota: Propagate ->quota_read errors from v2_read_file_info()
    quota: Fix error codes in v2_read_file_info()
    quota: Push dqio_sem down to ->read_file_info()
    quota: Push dqio_sem down to ->write_file_info()
    quota: Push dqio_sem down to ->get_next_id()
    quota: Push dqio_sem down to ->release_dqblk()
    quota: Remove locking for writing to the old quota format
    quota: Do not acquire dqio_sem for dquot overwrites in v2 format
    ...

    Linus Torvalds
     

21 Aug, 2017

1 commit


18 Aug, 2017

9 commits


09 Feb, 2016

1 commit


04 Jan, 2016

1 commit


04 Mar, 2015

1 commit

  • 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
     

30 Jan, 2015

1 commit

  • Currently maximum space limit quota format supports is in blocks however
    since we store space limits in bytes, this is somewhat confusing. So
    store the maximum limit in bytes as well. Also rename the field to match
    the new unit and related inode field to match the new naming scheme.

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

    Jan Kara
     

22 Jan, 2015

1 commit

  • 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
     

18 Sep, 2012

1 commit

  • Change struct dquot dq_id to a struct kqid and remove the now
    unecessary dq_type.

    Make minimal changes to dquot, quota_tree, quota_v1, quota_v2, ext3,
    ext4, and ocfs2 to deal with the change in quota structures and
    signatures. The ocfs2 changes are larger than most because of the
    extensive tracing throughout the ocfs2 quota code that prints out
    dq_id.

    quota_tree.c:get_index is modified to take a struct kqid instead of a
    qid_t because all of it's callers pass in dquot->dq_id and it allows
    me to introduce only a single conversion.

    The rest of the changes are either just replacing dq_type with dq_id.type,
    adding conversions to deal with the change in type and occassionally
    adding qid_eq to allow quota id comparisons in a user namespace safe way.

    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Jan Kara
    Cc: Andrew Morton
    Cc: Andreas Dilger
    Cc: Theodore Tso
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

24 Feb, 2011

1 commit


21 Jul, 2010

1 commit

  • The current quota error message doesn't always print the disk name, so
    it is hard to identify the "bad" disk when quota error happens.

    This patch changes the standardized quota error message to print out disk name
    and function name. It also uses a combination of cpp macro and inline function
    to provide better type checking and to lower the text size of the message.

    [Jan Kara: Export __quota_error]

    Signed-off-by: Jiaying Zhang
    Signed-off-by: Jan Kara

    Jiaying Zhang
     

22 May, 2010

1 commit


23 Dec, 2009

2 commits


10 Dec, 2009

2 commits


26 Mar, 2009

2 commits