Merge tag 'scsi-postmerge' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb...
[linux-2.6-microblaze.git] / fs / xfs / xfs_dquot.c
index f248708..43572f8 100644 (file)
@@ -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;
@@ -1010,6 +956,7 @@ xfs_qm_dqflush(
        struct xfs_mount        *mp = dqp->q_mount;
        struct xfs_buf          *bp;
        struct xfs_disk_dquot   *ddqp;
+       xfs_failaddr_t          fa;
        int                     error;
 
        ASSERT(XFS_DQ_IS_LOCKED(dqp));
@@ -1056,9 +1003,10 @@ xfs_qm_dqflush(
        /*
         * A simple sanity check in case we got a corrupted dquot..
         */
-       error = xfs_dqcheck(mp, &dqp->q_core, be32_to_cpu(ddqp->d_id), 0,
-                          XFS_QMOPT_DOWARN, "dqflush (incore copy)");
-       if (error) {
+       fa = xfs_dquot_verify(mp, &dqp->q_core, be32_to_cpu(ddqp->d_id), 0, 0);
+       if (fa) {
+               xfs_alert(mp, "corrupt dquot ID 0x%x in memory at %pS",
+                               be32_to_cpu(ddqp->d_id), fa);
                xfs_buf_relse(bp);
                xfs_dqfunlock(dqp);
                xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);