|
@@ -399,52 +399,6 @@ error0:
|
|
|
return error;
|
|
|
}
|
|
|
|
|
|
-STATIC int
|
|
|
-xfs_qm_dqrepair(
|
|
|
- struct xfs_mount *mp,
|
|
|
- struct xfs_trans *tp,
|
|
|
- struct xfs_dquot *dqp,
|
|
|
- xfs_dqid_t firstid,
|
|
|
- struct xfs_buf **bpp)
|
|
|
-{
|
|
|
- int error;
|
|
|
- struct xfs_disk_dquot *ddq;
|
|
|
- struct xfs_dqblk *d;
|
|
|
- int i;
|
|
|
-
|
|
|
- /*
|
|
|
- * Read the buffer without verification so we get the corrupted
|
|
|
- * buffer returned to us. make sure we verify it on write, though.
|
|
|
- */
|
|
|
- error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, dqp->q_blkno,
|
|
|
- mp->m_quotainfo->qi_dqchunklen,
|
|
|
- 0, bpp, NULL);
|
|
|
-
|
|
|
- if (error) {
|
|
|
- ASSERT(*bpp == NULL);
|
|
|
- return error;
|
|
|
- }
|
|
|
- (*bpp)->b_ops = &xfs_dquot_buf_ops;
|
|
|
-
|
|
|
- ASSERT(xfs_buf_islocked(*bpp));
|
|
|
- d = (struct xfs_dqblk *)(*bpp)->b_addr;
|
|
|
-
|
|
|
- /* Do the actual repair of dquots in this buffer */
|
|
|
- for (i = 0; i < mp->m_quotainfo->qi_dqperchunk; i++) {
|
|
|
- ddq = &d[i].dd_diskdq;
|
|
|
- error = xfs_dqcheck(mp, ddq, firstid + i,
|
|
|
- dqp->dq_flags & XFS_DQ_ALLTYPES,
|
|
|
- XFS_QMOPT_DQREPAIR, "xfs_qm_dqrepair");
|
|
|
- if (error) {
|
|
|
- /* repair failed, we're screwed */
|
|
|
- xfs_trans_brelse(tp, *bpp);
|
|
|
- return -EIO;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* Maps a dquot to the buffer containing its on-disk version.
|
|
|
* This returns a ptr to the buffer containing the on-disk dquot
|
|
@@ -526,14 +480,6 @@ xfs_qm_dqtobp(
|
|
|
dqp->q_blkno,
|
|
|
mp->m_quotainfo->qi_dqchunklen,
|
|
|
0, &bp, &xfs_dquot_buf_ops);
|
|
|
-
|
|
|
- if (error == -EFSCORRUPTED && (flags & XFS_QMOPT_DQREPAIR)) {
|
|
|
- xfs_dqid_t firstid = (xfs_dqid_t)map.br_startoff *
|
|
|
- mp->m_quotainfo->qi_dqperchunk;
|
|
|
- ASSERT(bp == NULL);
|
|
|
- error = xfs_qm_dqrepair(mp, tp, dqp, firstid, &bp);
|
|
|
- }
|
|
|
-
|
|
|
if (error) {
|
|
|
ASSERT(bp == NULL);
|
|
|
return error;
|