From: Jan Schmidt <list.btrfs@jan-o-sch.net>
To: Wang Shilong <wangshilong1991@gmail.com>
Cc: linux-btrfs@vger.kernel.org, sensille@gmx.net,
miaox@cn.fujitsu.com, wangsl-fnst@cn.fujitsu.com
Subject: Re: [PATCH V2 1/6] Btrfs: introduce a mutex lock for btrfs quota operations
Date: Tue, 02 Apr 2013 14:19:48 +0200 [thread overview]
Message-ID: <515ACCE4.5030800@jan-o-sch.net> (raw)
In-Reply-To: <1364468024-1636-1-git-send-email-wangshilong1991@gmail.com>
Hi Wang,
On Thu, March 28, 2013 at 11:53 (+0100), Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>
> This patch introduces mutex lock 'quota_lock', and makes
> all the user change for quota protected by quota_lock.
Can you please add a few lines why this lock is needed? I.e., which ioctls fail
without that kind of synchronization?
> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> fs/btrfs/ctree.h | 3 +++
> fs/btrfs/disk-io.c | 1 +
> fs/btrfs/ioctl.c | 16 ++++++++++++----
> 3 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 6e81860..a11a8ed 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -1584,6 +1584,9 @@ struct btrfs_fs_info {
> struct rb_root qgroup_tree;
> spinlock_t qgroup_lock;
>
> + /* protect user change operations for quota */
> + struct mutex quota_lock;
Having fs_info->qgroup_lock and fs_info->quota_lock going to be a major source
of confusion. I'd call the new one qgroup_ioctl_lock or ioctl_qgroup_lock instead.
Furthermore, the term "quota" was intentionally left unused to leave room for
other quota implementations later (user quota).
And, please, use --thread with git send-email for related patches to get correct
headers.
Thanks,
-Jan
> [snip]
next prev parent reply other threads:[~2013-04-02 12:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 10:54 [PATCH V2 0/6] add a mutex lock to avoid race condition and have all the ioctls check Wang Shilong
2013-03-28 10:53 ` [PATCH V2 1/6] Btrfs: introduce a mutex lock for btrfs quota operations Wang Shilong
2013-03-30 23:41 ` Arne Jansen
2013-03-31 1:12 ` Wang Shilong
2013-04-02 12:19 ` Jan Schmidt [this message]
2013-04-02 12:26 ` Wang Shilong
2013-03-28 10:54 ` [PATCH V2 2/6] Btrfs: remove some unnecessary spin_lock usages Wang Shilong
2013-03-30 23:41 ` Arne Jansen
2013-03-28 10:54 ` [PATCH V2 3/6] Btrfs: fix missing check before updating qgroup limit Wang Shilong
2013-03-28 10:54 ` [PATCH V2 4/6] Btrfs: fix missing check before creating/destroying a qgroup Wang Shilong
2013-03-28 10:54 ` [PATCH V2 5/6] Btrfs: fix missing check before assigning/removing qgroup relation Wang Shilong
2013-03-28 13:21 ` Josef Bacik
2013-03-28 14:06 ` Wang Shilong
2013-03-28 10:54 ` [PATCH V2 6/6] Btrfs: fix missing check before btrfs_qgroup_inherit() Wang Shilong
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=515ACCE4.5030800@jan-o-sch.net \
--to=list.btrfs@jan-o-sch.net \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
--cc=sensille@gmx.net \
--cc=wangshilong1991@gmail.com \
--cc=wangsl-fnst@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox