aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index c5eb6c646177..da46e14388f4 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -265,7 +265,7 @@ static int bh_get(struct gfs2_quota_data *qd)
265 error = gfs2_block_map(&ip->i_inode, block, 0, &bh_map, 1); 265 error = gfs2_block_map(&ip->i_inode, block, 0, &bh_map, 1);
266 if (error) 266 if (error)
267 goto fail; 267 goto fail;
268 error = gfs2_meta_read(ip->i_gl, bh_map.b_blocknr, DIO_START | DIO_WAIT, &bh); 268 error = gfs2_meta_read(ip->i_gl, bh_map.b_blocknr, DIO_WAIT, &bh);
269 if (error) 269 if (error)
270 goto fail; 270 goto fail;
271 error = -EIO; 271 error = -EIO;
@@ -1059,8 +1059,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1059 u32 extlen = 0; 1059 u32 extlen = 0;
1060 int error; 1060 int error;
1061 1061
1062 if (!ip->i_di.di_size || 1062 if (!ip->i_di.di_size || ip->i_di.di_size > (64 << 20) ||
1063 ip->i_di.di_size > (64 << 20) ||
1064 ip->i_di.di_size & (sdp->sd_sb.sb_bsize - 1)) { 1063 ip->i_di.di_size & (sdp->sd_sb.sb_bsize - 1)) {
1065 gfs2_consist_inode(ip); 1064 gfs2_consist_inode(ip);
1066 return -EIO; 1065 return -EIO;
@@ -1091,19 +1090,16 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1091 if (error) 1090 if (error)
1092 goto fail; 1091 goto fail;
1093 } 1092 }
1094 gfs2_meta_ra(ip->i_gl, dblock, extlen);
1095 error = gfs2_meta_read(ip->i_gl, dblock, DIO_START | DIO_WAIT,
1096 &bh);
1097 if (error)
1098 goto fail;
1099 error = -EIO; 1093 error = -EIO;
1094 bh = gfs2_meta_ra(ip->i_gl, dblock, extlen);
1095 if (!bh)
1096 goto fail;
1100 if (gfs2_metatype_check(sdp, bh, GFS2_METATYPE_QC)) { 1097 if (gfs2_metatype_check(sdp, bh, GFS2_METATYPE_QC)) {
1101 brelse(bh); 1098 brelse(bh);
1102 goto fail; 1099 goto fail;
1103 } 1100 }
1104 1101
1105 for (y = 0; 1102 for (y = 0; y < sdp->sd_qc_per_block && slot < sdp->sd_quota_slots;
1106 y < sdp->sd_qc_per_block && slot < sdp->sd_quota_slots;
1107 y++, slot++) { 1103 y++, slot++) {
1108 struct gfs2_quota_change qc; 1104 struct gfs2_quota_change qc;
1109 struct gfs2_quota_data *qd; 1105 struct gfs2_quota_data *qd;