Skip to content

Commit

Permalink
GFS2: panics on quotacheck update
Browse files Browse the repository at this point in the history
Handle block allocation for forceful unstuffing of quota dinode during quota
update using quotactl(). Also fix block reservation for special cases when
quotas cross over block boundaries and update 2 blocks instead of 1.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Abhijith Das authored and Steven Whitehouse committed Feb 7, 2011
1 parent b9c93bb commit e79a46a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,8 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id,

offset = qd2offset(qd);
alloc_required = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota));
if (gfs2_is_stuffed(ip))
alloc_required = 1;
if (alloc_required) {
al = gfs2_alloc_get(ip);
if (al == NULL)
Expand All @@ -1600,7 +1602,9 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id,
blocks += gfs2_rg_blocks(al);
}

error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 1, 0);
/* Some quotas span block boundaries and can update two blocks,
adding an extra block to the transaction to handle such quotas */
error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 2, 0);
if (error)
goto out_release;

Expand Down

0 comments on commit e79a46a

Please sign in to comment.