All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: miaoxie@huawei.com, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH 2/3] f2fs: quota: decrease the lock granularity of statfs_project
Date: Tue, 24 Jul 2018 20:17:53 +0800	[thread overview]
Message-ID: <20180724121754.19920-2-shengyong1@huawei.com> (raw)
In-Reply-To: <20180724121754.19920-1-shengyong1@huawei.com>

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>
---
 fs/f2fs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 796a2d756572..4ed91ceab3ee 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1118,7 +1118,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 :
@@ -1141,7 +1141,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;
 }
-- 
2.17.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2018-07-24 12:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 12:17 [PATCH 1/3] f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled Sheng Yong
2018-07-24 12:17 ` Sheng Yong [this message]
2018-07-25 15:41   ` [PATCH 2/3] f2fs: quota: decrease the lock granularity of statfs_project Chao Yu
2018-07-24 12:17 ` [PATCH 3/3] f2fs: quota: fix incorrect error message and comments Sheng Yong
2018-07-25 15:44   ` Chao Yu
2018-07-26  1:58     ` Sheng Yong
2018-07-26 11:24   ` [PATCH v2] f2fs: quota: fix incorrect comments Sheng Yong
2018-07-26 11:33     ` Chao Yu
2018-07-25 15:27 ` [PATCH 1/3] f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180724121754.19920-2-shengyong1@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=miaoxie@huawei.com \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.