06 Jan, 2021

1 commit

  • [ Upstream commit 10f04d40a9fa29785206c619f80d8beedb778837 ]

    The on-disk quota format supports quota files with upto 2^32 blocks. Be
    careful when computing quota file offsets in the quota files from block
    numbers as they can overflow 32-bit types. Since quota files larger than
    4GB would require ~26 millions of quota users, this is mostly a
    theoretical concern now but better be careful, fuzzers would find the
    problem sooner or later anyway...

    Reviewed-by: Andreas Dilger
    Signed-off-by: Jan Kara
    Signed-off-by: Sasha Levin

    Jan Kara
     

26 Dec, 2020

2 commits

  • …cleanup_quota_inode()

    commit e51d68e76d604c6d5d1eb13ae1d6da7f6c8c0dfc upstream.

    When dquot_resume() was last updated, the argument that got passed
    to vfs_cleanup_quota_inode was incorrectly set.

    If type = -1 and dquot_load_quota_sb() returns a negative value,
    then vfs_cleanup_quota_inode() gets called with -1 passed as an
    argument, and this leads to an array-index-out-of-bounds bug.

    Fix this issue by correctly passing the arguments.

    Fixes: ae45f07d47cc ("quota: Simplify dquot_resume()")
    Link: https://lore.kernel.org/r/20201208194338.7064-1-anant.thazhemadam@gmail.com
    Reported-by: syzbot+2643e825238d7aabb37f@syzkaller.appspotmail.com
    Tested-by: syzbot+2643e825238d7aabb37f@syzkaller.appspotmail.com
    CC: stable@vger.kernel.org
    Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    Anant Thazhemadam
     
  • commit 11c514a99bb960941535134f0587102855e8ddee upstream.

    Perform basic sanity checks of quota headers to avoid kernel crashes on
    corrupted quota files.

    CC: stable@vger.kernel.org
    Reported-by: syzbot+f816042a7ae2225f25ba@syzkaller.appspotmail.com
    Reviewed-by: Andreas Dilger
    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     

16 Oct, 2020

1 commit

  • Pull UDF, reiserfs, ext2, quota fixes from Jan Kara:

    - a couple of UDF fixes for issues found by syzbot fuzzing

    - a couple of reiserfs fixes for issues found by syzbot fuzzing

    - some minor ext2 cleanups

    - quota patches to support grace times beyond year 2038 for XFS quota
    APIs

    * tag 'fs_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    reiserfs: Fix oops during mount
    udf: Limit sparing table size
    udf: Remove pointless union in udf_inode_info
    udf: Avoid accessing uninitialized data on failed inode read
    quota: clear padding in v2r1_mem2diskdqb()
    reiserfs: Initialize inode keys properly
    udf: Fix memory leak when mounting
    udf: Remove redundant initialization of variable ret
    reiserfs: only call unlock_new_inode() if I_NEW
    ext2: Fix some kernel-doc warnings in balloc.c
    quota: Expand comment describing d_itimer
    quota: widen timestamps for the fs_disk_quota structure
    reiserfs: Fix memory leak in reiserfs_parse_options()
    udf: Use kvzalloc() in udf_sb_alloc_bitmap()
    ext2: remove duplicate include

    Linus Torvalds
     

13 Oct, 2020

1 commit


25 Sep, 2020

1 commit

  • Freshly allocated memory contains garbage, better make sure
    to init all struct v2r1_disk_dqblk fields to avoid KMSAN report:

    BUG: KMSAN: uninit-value in qtree_entry_unused+0x137/0x1b0 fs/quota/quota_tree.c:218
    CPU: 0 PID: 23373 Comm: syz-executor.1 Not tainted 5.9.0-rc4-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x21c/0x280 lib/dump_stack.c:118
    kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:122
    __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:219
    qtree_entry_unused+0x137/0x1b0 fs/quota/quota_tree.c:218
    v2r1_mem2diskdqb+0x43d/0x710 fs/quota/quota_v2.c:285
    qtree_write_dquot+0x226/0x870 fs/quota/quota_tree.c:394
    v2_write_dquot+0x1ad/0x280 fs/quota/quota_v2.c:333
    dquot_commit+0x4af/0x600 fs/quota/dquot.c:482
    ext4_write_dquot fs/ext4/super.c:5934 [inline]
    ext4_mark_dquot_dirty+0x4d8/0x6a0 fs/ext4/super.c:5985
    mark_dquot_dirty fs/quota/dquot.c:347 [inline]
    mark_all_dquot_dirty fs/quota/dquot.c:385 [inline]
    dquot_alloc_inode+0xc05/0x12b0 fs/quota/dquot.c:1755
    __ext4_new_inode+0x8204/0x9d70 fs/ext4/ialloc.c:1155
    ext4_tmpfile+0x41a/0x850 fs/ext4/namei.c:2686
    vfs_tmpfile+0x2a2/0x570 fs/namei.c:3283
    do_tmpfile fs/namei.c:3316 [inline]
    path_openat+0x4035/0x6a90 fs/namei.c:3359
    do_filp_open+0x2b8/0x710 fs/namei.c:3395
    do_sys_openat2+0xa88/0x1140 fs/open.c:1168
    do_sys_open fs/open.c:1184 [inline]
    __do_compat_sys_openat fs/open.c:1242 [inline]
    __se_compat_sys_openat+0x2a4/0x310 fs/open.c:1240
    __ia32_compat_sys_openat+0x56/0x70 fs/open.c:1240
    do_syscall_32_irqs_on arch/x86/entry/common.c:80 [inline]
    __do_fast_syscall_32+0x129/0x180 arch/x86/entry/common.c:139
    do_fast_syscall_32+0x6a/0xc0 arch/x86/entry/common.c:162
    do_SYSENTER_32+0x73/0x90 arch/x86/entry/common.c:205
    entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
    RIP: 0023:0xf7ff4549
    Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90
    RSP: 002b:00000000f55cd0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000127
    RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020000000
    RDX: 0000000000410481 RSI: 0000000000000000 RDI: 0000000000000000
    RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
    R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

    Uninit was created at:
    kmsan_save_stack_with_flags mm/kmsan/kmsan.c:143 [inline]
    kmsan_internal_poison_shadow+0x66/0xd0 mm/kmsan/kmsan.c:126
    kmsan_slab_alloc+0x8a/0xe0 mm/kmsan/kmsan_hooks.c:80
    slab_alloc_node mm/slub.c:2907 [inline]
    slab_alloc mm/slub.c:2916 [inline]
    __kmalloc+0x2bb/0x4b0 mm/slub.c:3982
    kmalloc include/linux/slab.h:559 [inline]
    getdqbuf+0x56/0x150 fs/quota/quota_tree.c:52
    qtree_write_dquot+0xf2/0x870 fs/quota/quota_tree.c:378
    v2_write_dquot+0x1ad/0x280 fs/quota/quota_v2.c:333
    dquot_commit+0x4af/0x600 fs/quota/dquot.c:482
    ext4_write_dquot fs/ext4/super.c:5934 [inline]
    ext4_mark_dquot_dirty+0x4d8/0x6a0 fs/ext4/super.c:5985
    mark_dquot_dirty fs/quota/dquot.c:347 [inline]
    mark_all_dquot_dirty fs/quota/dquot.c:385 [inline]
    dquot_alloc_inode+0xc05/0x12b0 fs/quota/dquot.c:1755
    __ext4_new_inode+0x8204/0x9d70 fs/ext4/ialloc.c:1155
    ext4_tmpfile+0x41a/0x850 fs/ext4/namei.c:2686
    vfs_tmpfile+0x2a2/0x570 fs/namei.c:3283
    do_tmpfile fs/namei.c:3316 [inline]
    path_openat+0x4035/0x6a90 fs/namei.c:3359
    do_filp_open+0x2b8/0x710 fs/namei.c:3395
    do_sys_openat2+0xa88/0x1140 fs/open.c:1168
    do_sys_open fs/open.c:1184 [inline]
    __do_compat_sys_openat fs/open.c:1242 [inline]
    __se_compat_sys_openat+0x2a4/0x310 fs/open.c:1240
    __ia32_compat_sys_openat+0x56/0x70 fs/open.c:1240
    do_syscall_32_irqs_on arch/x86/entry/common.c:80 [inline]
    __do_fast_syscall_32+0x129/0x180 arch/x86/entry/common.c:139
    do_fast_syscall_32+0x6a/0xc0 arch/x86/entry/common.c:162
    do_SYSENTER_32+0x73/0x90 arch/x86/entry/common.c:205
    entry_SYSENTER_compat_after_hwframe+0x4d/0x5c

    Fixes: 498c60153ebb ("quota: Implement quota format with 64-bit space and inode limits")
    Link: https://lore.kernel.org/r/20200924183619.4176790-1-edumazet@google.com
    Signed-off-by: Eric Dumazet
    Cc: Jan Kara
    Signed-off-by: Jan Kara

    Eric Dumazet
     

18 Sep, 2020

1 commit


10 Sep, 2020

1 commit

  • Soon, XFS will support quota grace period expiration timestamps beyond
    the year 2038, widen the timestamp fields to handle the extra time bits.
    Internally, XFS now stores unsigned 34-bit quantities, so the extra 8
    bits here should work fine. (Note that XFS is the only user of this
    structure.)

    Link: https://lore.kernel.org/r/20200909163413.GJ7955@magnolia
    Signed-off-by: Darrick J. Wong
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Darrick J. Wong
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

07 Aug, 2020

1 commit

  • Pull ext2, udf, reiserfs, quota cleanups and minor fixes from Jan Kara:
    "A few ext2 fixups and then several (mostly comment and documentation)
    cleanups in ext2, udf, reiserfs, and quota"

    * tag 'for_v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    reiserfs: delete duplicated words
    udf: osta_udf.h: delete a duplicated word
    reiserfs: reiserfs.h: delete a duplicated word
    ext2: ext2.h: fix duplicated word + typos
    udf: Replace HTTP links with HTTPS ones
    quota: Fixup http links in quota doc
    Replace HTTP links with HTTPS ones: DISKQUOTA
    ext2: initialize quota info in ext2_xattr_set()
    ext2: fix some incorrect comments in inode.c
    ext2: remove nocheck option
    ext2: fix missing percpu_counter_inc
    ext2: ext2_find_entry() return -ENOENT if no entry found
    ext2: propagate errors up to ext2_find_entry()'s callers
    ext2: fix improper assignment for e_value_offs

    Linus Torvalds
     

09 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Link: https://lore.kernel.org/r/20200708171905.15396-1-grandmaster@al2klimov.de
    Signed-off-by: Alexander A. Klimov
    Signed-off-by: Jan Kara

    Alexander A. Klimov
     

24 Jun, 2020

1 commit


27 Apr, 2020

1 commit

  • Instead of having all the sysctl handlers deal with user pointers, which
    is rather hairy in terms of the BPF interaction, copy the input to and
    from userspace in common code. This also means that the strings are
    always NUL-terminated by the common code, making the API a little bit
    safer.

    As most handler just pass through the data to one of the common handlers
    a lot of the changes are mechnical.

    Signed-off-by: Christoph Hellwig
    Acked-by: Andrey Ignatov
    Signed-off-by: Al Viro

    Christoph Hellwig
     

31 Jan, 2020

1 commit

  • Pull UDF, quota, reiserfs, ext2 fixes and cleanups from Jan Kara:
    "A few assorted fixes and cleanups for udf, quota, reiserfs, and ext2"

    * tag 'for_v5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    fs/reiserfs: remove unused macros
    fs/quota: remove unused macro
    udf: Clarify meaning of f_files in udf_statfs
    udf: Allow writing to 'Rewritable' partitions
    udf: Disallow R/W mode for disk with Metadata partition
    udf: Fix meaning of ENTITYID_FLAGS_* macros to be really bitwise-or flags
    udf: Fix free space reporting for metadata and virtual partitions
    udf: Update header files to UDF 2.60
    udf: Move OSTA Identifier Suffix macros from ecma_167.h to osta_udf.h
    udf: Fix spelling in EXT_NEXT_EXTENT_ALLOCDESCS
    ext2: Adjust indentation in ext2_fill_super
    quota: avoid time_t in v1_disk_dqblk definition
    reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling
    reiserfs: Fix memory leak of journal device string
    ext2: set proper errno in error case of ext2_fill_super()

    Linus Torvalds
     

22 Jan, 2020

1 commit

  • __QUOTA_V2_PARANOIA macro is never used. better to remove it.

    Link: https://lore.kernel.org/r/1579602334-57039-1-git-send-email-alex.shi@linux.alibaba.com
    Signed-off-by: Alex Shi
    Cc: Jan Kara
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Jan Kara

    Alex Shi
     

18 Dec, 2019

1 commit

  • Anything that walks all inodes on sb->s_inodes list without rescheduling
    risks softlockups.

    Previous efforts were made in 2 functions, see:

    c27d82f fs/drop_caches.c: avoid softlockups in drop_pagecache_sb()
    ac05fbb inode: don't softlockup when evicting inodes

    but there hasn't been an audit of all walkers, so do that now. This
    also consistently moves the cond_resched() calls to the bottom of each
    loop in cases where it already exists.

    One loop remains: remove_dquot_ref(), because I'm not quite sure how
    to deal with that one w/o taking the i_lock.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Jan Kara
    Signed-off-by: Al Viro

    Eric Sandeen
     

16 Dec, 2019

1 commit

  • The time_t type is part of the user interface and not always the
    same, with the move to 64-bit timestamps and the difference between
    architectures.

    Make the quota format definition independent of this type and use
    a basic type of the same length. Make it unsigned in the process
    to keep the v1 format working until year 2106 instead of 2038
    on 32-bit architectures.

    Hopefully, everybody has already moved to a newer format long
    ago (v2 was introduced with linux-2.4), but it's hard to be sure.

    Link: https://lore.kernel.org/r/20191213205221.3787308-6-arnd@arndb.de
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jan Kara

    Arnd Bergmann
     

07 Dec, 2019

1 commit

  • Pull vfs d_inode/d_flags memory ordering fixes from Al Viro:
    "Fallout from tree-wide audit for ->d_inode/->d_flags barriers use.
    Basically, the problem is that negative pinned dentries require
    careful treatment - unless ->d_lock is locked or parent is held at
    least shared, another thread can make them positive right under us.

    Most of the uses turned out to be safe - the main surprises as far as
    filesystems are concerned were

    - race in dget_parent() fastpath, that might end up with the caller
    observing the returned dentry _negative_, due to insufficient
    barriers. It is positive in memory, but we could end up seeing the
    wrong value of ->d_inode in CPU cache. Fixed.

    - manual checks that result of lookup_one_len_unlocked() is positive
    (and rejection of negatives). Again, insufficient barriers (we
    might end up with inconsistent observed values of ->d_inode and
    ->d_flags). Fixed by switching to a new primitive that does the
    checks itself and returns ERR_PTR(-ENOENT) instead of a negative
    dentry. That way we get rid of boilerplate converting negatives
    into ERR_PTR(-ENOENT) in the callers and have a single place to
    deal with the barrier-related mess - inside fs/namei.c rather than
    in every caller out there.

    The guts of pathname resolution *do* need to be careful - the race
    found by Ritesh is real, as well as several similar races.
    Fortunately, it turns out that we can take care of that with fairly
    local changes in there.

    The tree-wide audit had not been fun, and I hate the idea of repeating
    it. I think the right approach would be to annotate the places where
    we are _not_ guaranteed ->d_inode/->d_flags stability and have sparse
    catch regressions. But I'm still not sure what would be the least
    invasive way of doing that and it's clearly the next cycle fodder"

    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    fs/namei.c: fix missing barriers when checking positivity
    fix dget_parent() fastpath race
    new helper: lookup_positive_unlocked()
    fs/namei.c: pull positivity check into follow_managed()

    Linus Torvalds
     

16 Nov, 2019

1 commit

  • Most of the callers of lookup_one_len_unlocked() treat negatives are
    ERR_PTR(-ENOENT). Provide a helper that would do just that. Note
    that a pinned positive dentry remains positive - it's ->d_inode is
    stable, etc.; a pinned _negative_ dentry can become positive at any
    point as long as you are not holding its parent at least shared.
    So using lookup_one_len_unlocked() needs to be careful;
    lookup_positive_unlocked() is safer and that's what the callers
    end up open-coding anyway.

    Signed-off-by: Al Viro

    Al Viro
     

11 Nov, 2019

1 commit

  • Quota statistics counted as 64-bit per-cpu counter. Reading sums per-cpu
    fractions as signed 64-bit int, filters negative values and then reports
    lower half as signed 32-bit int.

    Result may looks like:

    fs.quota.allocated_dquots = 22327
    fs.quota.cache_hits = -489852115
    fs.quota.drops = -487288718
    fs.quota.free_dquots = 22083
    fs.quota.lookups = -486883485
    fs.quota.reads = 22327
    fs.quota.syncs = 335064
    fs.quota.writes = 3088689

    Values bigger than 2^31-1 reported as negative.

    All counters except "allocated_dquots" and "free_dquots" are monotonic,
    thus they should be reported as is without filtering negative values.

    Kernel doesn't have generic helper for 64-bit sysctl yet,
    let's use at least unsigned long.

    Link: https://lore.kernel.org/r/157337934693.2078.9842146413181153727.stgit@buzz
    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Jan Kara

    Konstantin Khlebnikov
     

06 Nov, 2019

1 commit


04 Nov, 2019

6 commits

  • Make dquot_get_state() gracefully handle a situation when there are no
    quota files present even though quotas are enabled.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Quota on and quota off are protected by s_umount semaphore held in
    exclusive mode since commit 7d6cd73d33b6 "quota: Hold s_umount in
    exclusive mode when enabling / disabling quotas". This makes it
    impossible for dquot_disable() to race with other enabling or disabling
    of quotas. Simplify the cleanup done by dquot_disable() based on this
    fact and also remove some stale comments. As a bonus this cleanup makes
    dquot_disable() properly handle a case when there are no quota inodes.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Now dquot_enable() has only two internal callers and both of them just
    need to update quota flags and don't need most of checks. Just drop
    dquot_enable() and fold necessary functionality into the two calling
    places.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Rename vfs_load_quota_inode() to dquot_load_quota_inode() to be
    consistent with naming of other functions used for enabling quota
    accounting from filesystems. Also export the function and add some
    sanity checks to assure filesystems are calling the function properly.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • We already have quota inode loaded when resuming quotas. Use
    vfs_load_quota() to avoid some pointless churn with the quota inode.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Factor out setting up of quota inode and eventual error cleanup from
    vfs_load_quota_inode(). This will simplify situation for filesystems
    that don't have any quota inodes.

    Signed-off-by: Jan Kara

    Jan Kara
     

01 Nov, 2019

2 commits

  • There is a race window where quota was redirted once we drop dq_list_lock inside dqput(),
    but before we grab dquot->dq_lock inside dquot_release()

    TASK1 TASK2 (chowner)
    ->dqput()
    we_slept:
    spin_lock(&dq_list_lock)
    if (dquot_dirty(dquot)) {
    spin_unlock(&dq_list_lock);
    dquot->dq_sb->dq_op->write_dquot(dquot);
    goto we_slept
    if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
    spin_unlock(&dq_list_lock);
    dquot->dq_sb->dq_op->release_dquot(dquot);
    dqget()
    mark_dquot_dirty()
    dqput()
    goto we_slept;
    }
    So dquot dirty quota will be released by TASK1, but on next we_sleept loop
    we detect this and call ->write_dquot() for it.
    XFSTEST: https://github.com/dmonakhov/xfstests/commit/440a80d4cbb39e9234df4d7240aee1d551c36107

    Link: https://lore.kernel.org/r/20191031103920.3919-2-dmonakhov@openvz.org
    CC: stable@vger.kernel.org
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Jan Kara

    Dmitry Monakhov
     
  • Write only quotas which are dirty at entry.

    XFSTEST: https://github.com/dmonakhov/xfstests/commit/b10ad23566a5bf75832a6f500e1236084083cddc

    Link: https://lore.kernel.org/r/20191031103920.3919-1-dmonakhov@openvz.org
    CC: stable@vger.kernel.org
    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Jan Kara

    Dmitry Monakhov
     

17 Oct, 2019

1 commit


08 Oct, 2019

1 commit


04 Oct, 2019

2 commits


31 Jul, 2019

1 commit


11 Jul, 2019

1 commit

  • Pull ext2, udf and quota updates from Jan Kara:

    - some ext2 fixes and cleanups

    - a fix of udf bug when extending files

    - a fix of quota Q_XGETQSTAT[V] handling

    * tag 'for_v5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
    ext2: Use kmemdup rather than duplicating its implementation
    quota: honor quota type in Q_XGETQSTAT[V] calls
    ext2: Always brelse bh on failure in ext2_iget()
    ext2: add missing brelse() in ext2_iget()
    ext2: Fix a typo in ext2_getattr argument
    ext2: fix a typo in comment
    ext2: add missing brelse() in ext2_new_inode()
    ext2: optimize ext2_xattr_get()
    ext2: introduce new helper for xattr entry comparison
    ext2: merge xattr next entry check to ext2_xattr_entry_valid()
    ext2: code cleanup for ext2_preread_inode()
    ext2: code cleanup by using test_opt() and clear_opt()
    doc: ext2: update description of quota options for ext2
    ext2: Strengthen xattr block checks
    ext2: Merge loops in ext2_xattr_set()
    ext2: introduce helper for xattr entry validation
    ext2: introduce helper for xattr header validation
    quota: add dqi_dirty_list description to comment of Dquot List Management

    Linus Torvalds
     

25 Jun, 2019

1 commit

  • The code in quota_getstate and quota_getstatev is strange; it
    says the returned fs_quota_stat[v] structure has room for only
    one type of time limits, so fills it in with the first enabled
    quota, even though every quotactl command must have a type sent
    in by the user.

    Instead of just picking the first enabled quota, fill in the
    reply with the timers for the quota type that was actually
    requested.

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

    Eric Sandeen
     

19 Jun, 2019

1 commit

  • Run below script as root, dquot_add_space will return -EDQUOT since
    __dquot_transfer call dquot_add_space with flags=0, and dquot_add_space
    think it's a preallocation. Fix it by set flags as DQUOT_SPACE_WARN.

    mkfs.ext4 -O quota,project /dev/vdb
    mount -o prjquota /dev/vdb /mnt
    setquota -P 23 1 1 0 0 /dev/vdb
    dd if=/dev/zero of=/mnt/test-file bs=4K count=1
    chattr -p 23 test-file

    Fixes: 7b9ca4c61bc2 ("quota: Reduce contention on dq_data_lock")
    Signed-off-by: yangerkun
    Signed-off-by: Jan Kara

    yangerkun
     

21 May, 2019

2 commits


20 May, 2019

1 commit