cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH 1/4] gfs2: check quota for blocks we're about to allocate
Date: Thu, 12 Feb 2015 18:12:50 +0000	[thread overview]
Message-ID: <54DCED22.1050500@redhat.com> (raw)
In-Reply-To: <1423760054-63438-2-git-send-email-adas@redhat.com>

Hi Abhi,

On 12/02/15 16:54, Abhi Das wrote:
> This patch allows gfs2_quota_check() to take an extra argument
> called 'exp_change'. Prior to any allocation, gfs2_quota_check()
> or gfs2_quota_lock_check() is called with exp_change containing
> the number of blocks we expect to allocate in this operation.
> gfs2_quota_check() will add this number to the current usage and
> check the sum against the quota warns and limits and fail the
> operation if necessary.
>
<snip>
> -int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
> +int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid, s64 exp_change)
>   {
>   	struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
>   	struct gfs2_quota_data *qd;
> @@ -1116,7 +1116,7 @@ int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
>
>   		value = (s64)be64_to_cpu(qd->qd_qb.qb_value);
>   		spin_lock(&qd_lock);
> -		value += qd->qd_change;
> +		value += qd->qd_change + exp_change;

So I guess I don't understand why we need both qd_change and exp_change 
now. What sets qd_change, and why can't it be accurate (i.e. equal to 
exp_change) when we need it to be?

Andy



  reply	other threads:[~2015-02-12 18:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 16:54 [Cluster-devel] [GFS2 PATCH 0/4] fallocate quota fixes Abhi Das
2015-02-12 16:54 ` [Cluster-devel] [GFS2 PATCH 1/4] gfs2: check quota for blocks we're about to allocate Abhi Das
2015-02-12 18:12   ` Andrew Price [this message]
2015-02-12 18:23     ` Abhijith Das
2015-02-12 16:54 ` [Cluster-devel] [GFS2 PATCH 2/4] gfs2: add new quota check functions Abhi Das
2015-02-13 13:34   ` Steven Whitehouse
2015-02-12 16:54 ` [Cluster-devel] [GFS2 PATCH 3/4] gfs2: add new function gfs2_inpl_rsrv_ret_max_avl Abhi Das
2015-02-13 13:36   ` Steven Whitehouse
2015-02-12 16:54 ` [Cluster-devel] [GFS2 PATCH 4/4] gfs2: allow fallocate to max out quotas/fs efficiently Abhi Das
2015-02-12 17:47 ` [Cluster-devel] [GFS2 PATCH 0/4] fallocate quota fixes Bob Peterson

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=54DCED22.1050500@redhat.com \
    --to=anprice@redhat.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;
as well as URLs for NNTP newsgroup(s).