diff options
author | Abhi Das <adas@redhat.com> | 2015-06-02 11:02:24 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2015-06-02 11:02:24 -0500 |
commit | 39a725803beeffeb319261df1ab145ef3c1ea0a1 (patch) | |
tree | ed5e6b7755daa76b1cd28d3b8260f5ba3afa7007 /fs/gfs2/inode.c | |
parent | a3e3213676d8208328ef9f79936f94e583c0ec90 (diff) |
gfs2: fix quota updates on block boundaries
For smaller block sizes (512B, 1K, 2K), some quotas straddle block
boundaries such that the usage value is on one block and the rest
of the quota is on the previous block. In such cases, the value
does not get updated correctly. This patch fixes that by addressing
the boundary conditions correctly.
This patch also adds a (s64) cast that was missing in a call to
gfs2_quota_change() in inode.c
Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 4d809eb71b48..a088e54090f5 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1889,7 +1889,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) if (!uid_eq(ouid, NO_UID_QUOTA_CHANGE) || !gid_eq(ogid, NO_GID_QUOTA_CHANGE)) { - gfs2_quota_change(ip, -ap.target, ouid, ogid); + gfs2_quota_change(ip, -(s64)ap.target, ouid, ogid); gfs2_quota_change(ip, ap.target, nuid, ngid); } |