]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
f2fs: quota: decrease the lock granularity of statfs_project
authorSheng Yong <shengyong1@huawei.com>
Tue, 24 Jul 2018 12:17:53 +0000 (20:17 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 1 Aug 2018 18:52:36 +0000 (11:52 -0700)
According to fs/quota/dquot.c, `dq_data_lock' protects mem_dqinfo
structures and modifications of dquot pointers in the inode, and
`dquot->dq_dqb_lock' protects data from dq_dqb.

We should use dquot->dq_dqb_lock in statfs_project instead of
dq_dat_lock.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 609ea8736dbfd109a0884ffef5d7a698a05ae70e..bdea57067bc0891d78c08471f36ca5c9f85fef16 100644 (file)
@@ -1117,7 +1117,7 @@ static int f2fs_statfs_project(struct super_block *sb,
        dquot = dqget(sb, qid);
        if (IS_ERR(dquot))
                return PTR_ERR(dquot);
-       spin_lock(&dq_data_lock);
+       spin_lock(&dquot->dq_dqb_lock);
 
        limit = (dquot->dq_dqb.dqb_bsoftlimit ?
                 dquot->dq_dqb.dqb_bsoftlimit :
@@ -1140,7 +1140,7 @@ static int f2fs_statfs_project(struct super_block *sb,
                         (buf->f_files - dquot->dq_dqb.dqb_curinodes) : 0;
        }
 
-       spin_unlock(&dq_data_lock);
+       spin_unlock(&dquot->dq_dqb_lock);
        dqput(dquot);
        return 0;
 }