diff options
-rw-r--r-- | fs/gfs2/quota.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index a689901963de..6ec964c31dc6 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -1587,6 +1587,8 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id, | |||
1587 | 1587 | ||
1588 | offset = qd2offset(qd); | 1588 | offset = qd2offset(qd); |
1589 | alloc_required = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota)); | 1589 | alloc_required = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota)); |
1590 | if (gfs2_is_stuffed(ip)) | ||
1591 | alloc_required = 1; | ||
1590 | if (alloc_required) { | 1592 | if (alloc_required) { |
1591 | al = gfs2_alloc_get(ip); | 1593 | al = gfs2_alloc_get(ip); |
1592 | if (al == NULL) | 1594 | if (al == NULL) |
@@ -1600,7 +1602,9 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id, | |||
1600 | blocks += gfs2_rg_blocks(al); | 1602 | blocks += gfs2_rg_blocks(al); |
1601 | } | 1603 | } |
1602 | 1604 | ||
1603 | error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 1, 0); | 1605 | /* Some quotas span block boundaries and can update two blocks, |
1606 | adding an extra block to the transaction to handle such quotas */ | ||
1607 | error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 2, 0); | ||
1604 | if (error) | 1608 | if (error) |
1605 | goto out_release; | 1609 | goto out_release; |
1606 | 1610 | ||