Skip to content

Commit

Permalink
gfs2: Remove quota allocation info from quota file
Browse files Browse the repository at this point in the history
Function do_sync called gfs2_qa_get and put for quota allocation data.
But the inode in question is the system master quota file, which is
never subject to quotas. Therefore, a qa structure should be unnecessary
and if anything accesses it, it's probably a bug.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
AstralBob authored and Andreas Gruenbacher committed Sep 5, 2023
1 parent c9ff3c6 commit 3932e50
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,18 +905,12 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
unsigned int nalloc = 0, blocks;
int error;

error = gfs2_qa_get(ip);
if (error)
return error;

gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
&data_blocks, &ind_blocks);

ghs = kmalloc_array(num_qd, sizeof(struct gfs2_holder), GFP_NOFS);
if (!ghs) {
error = -ENOMEM;
goto out;
}
if (!ghs)
return -ENOMEM;

sort(qda, num_qd, sizeof(struct gfs2_quota_data *), sort_qd, NULL);
inode_lock(&ip->i_inode);
Expand Down Expand Up @@ -989,8 +983,6 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
kfree(ghs);
gfs2_log_flush(ip->i_gl->gl_name.ln_sbd, ip->i_gl,
GFS2_LOG_HEAD_FLUSH_NORMAL | GFS2_LFC_DO_SYNC);
out:
gfs2_qa_put(ip);
if (!error) {
for (x = 0; x < num_qd; x++)
qda[x]->qd_sync_gen = sdp->sd_quota_sync_gen;
Expand Down

0 comments on commit 3932e50

Please sign in to comment.