]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
quota: fix a problem about transfer quota
authoryangerkun <yangerkun@huawei.com>
Tue, 26 Mar 2019 14:00:02 +0000 (22:00 +0800)
committerJan Kara <jack@suse.cz>
Wed, 19 Jun 2019 13:25:41 +0000 (15:25 +0200)
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 <yangerkun@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/dquot.c

index 9ad72ea7f71f5d71608c470992c871aa7bbe2f15..58f15a083dd11d4f945be0c05f40437d103d6288 100644 (file)
@@ -1996,8 +1996,8 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
                                       &warn_to[cnt]);
                if (ret)
                        goto over_quota;
-               ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0,
-                                     &warn_to[cnt]);
+               ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space,
+                                     DQUOT_SPACE_WARN, &warn_to[cnt]);
                if (ret) {
                        spin_lock(&transfer_to[cnt]->dq_dqb_lock);
                        dquot_decr_inodes(transfer_to[cnt], inode_usage);