aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_ialloc.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2015-02-23 06:39:08 -0500
committerDave Chinner <david@fromorbit.com>2015-02-23 06:39:08 -0500
commitc29aad41159829c0e1dcbf06c8e02284993b7901 (patch)
tree67b3c61640af5e729b58d76c70e551888470c9da /fs/xfs/libxfs/xfs_ialloc.c
parent58c904734cd0917cd0953067dd68003572407c7b (diff)
xfs: pass mp to XFS_WANT_CORRUPTED_GOTO
Today, if we hit an XFS_WANT_CORRUPTED_GOTO we don't print any information about which filesystem hit it. Passing in the mp allows us to print the filesystem (device) name, which is a pretty critical piece of information. Tested by running fsfuzzer 'til I hit some. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 116ef1ddb3e3..f95c4ae46e28 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -783,12 +783,12 @@ xfs_dialloc_ag_inobt(
783 error = xfs_inobt_lookup(cur, pagino, XFS_LOOKUP_LE, &i); 783 error = xfs_inobt_lookup(cur, pagino, XFS_LOOKUP_LE, &i);
784 if (error) 784 if (error)
785 goto error0; 785 goto error0;
786 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 786 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
787 787
788 error = xfs_inobt_get_rec(cur, &rec, &j); 788 error = xfs_inobt_get_rec(cur, &rec, &j);
789 if (error) 789 if (error)
790 goto error0; 790 goto error0;
791 XFS_WANT_CORRUPTED_GOTO(j == 1, error0); 791 XFS_WANT_CORRUPTED_GOTO(mp, j == 1, error0);
792 792
793 if (rec.ir_freecount > 0) { 793 if (rec.ir_freecount > 0) {
794 /* 794 /*
@@ -944,19 +944,19 @@ newino:
944 error = xfs_inobt_lookup(cur, 0, XFS_LOOKUP_GE, &i); 944 error = xfs_inobt_lookup(cur, 0, XFS_LOOKUP_GE, &i);
945 if (error) 945 if (error)
946 goto error0; 946 goto error0;
947 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 947 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
948 948
949 for (;;) { 949 for (;;) {
950 error = xfs_inobt_get_rec(cur, &rec, &i); 950 error = xfs_inobt_get_rec(cur, &rec, &i);
951 if (error) 951 if (error)
952 goto error0; 952 goto error0;
953 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 953 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
954 if (rec.ir_freecount > 0) 954 if (rec.ir_freecount > 0)
955 break; 955 break;
956 error = xfs_btree_increment(cur, 0, &i); 956 error = xfs_btree_increment(cur, 0, &i);
957 if (error) 957 if (error)
958 goto error0; 958 goto error0;
959 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 959 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
960 } 960 }
961 961
962alloc_inode: 962alloc_inode:
@@ -1039,10 +1039,10 @@ xfs_dialloc_ag_finobt_near(
1039 error = xfs_inobt_get_rec(rcur, &rrec, &j); 1039 error = xfs_inobt_get_rec(rcur, &rrec, &j);
1040 if (error) 1040 if (error)
1041 goto error_rcur; 1041 goto error_rcur;
1042 XFS_WANT_CORRUPTED_GOTO(j == 1, error_rcur); 1042 XFS_WANT_CORRUPTED_GOTO(lcur->bc_mp, j == 1, error_rcur);
1043 } 1043 }
1044 1044
1045 XFS_WANT_CORRUPTED_GOTO(i == 1 || j == 1, error_rcur); 1045 XFS_WANT_CORRUPTED_GOTO(lcur->bc_mp, i == 1 || j == 1, error_rcur);
1046 if (i == 1 && j == 1) { 1046 if (i == 1 && j == 1) {
1047 /* 1047 /*
1048 * Both the left and right records are valid. Choose the closer 1048 * Both the left and right records are valid. Choose the closer
@@ -1475,14 +1475,14 @@ xfs_difree_inobt(
1475 __func__, error); 1475 __func__, error);
1476 goto error0; 1476 goto error0;
1477 } 1477 }
1478 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1478 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
1479 error = xfs_inobt_get_rec(cur, &rec, &i); 1479 error = xfs_inobt_get_rec(cur, &rec, &i);
1480 if (error) { 1480 if (error) {
1481 xfs_warn(mp, "%s: xfs_inobt_get_rec() returned error %d.", 1481 xfs_warn(mp, "%s: xfs_inobt_get_rec() returned error %d.",
1482 __func__, error); 1482 __func__, error);
1483 goto error0; 1483 goto error0;
1484 } 1484 }
1485 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1485 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error0);
1486 /* 1486 /*
1487 * Get the offset in the inode chunk. 1487 * Get the offset in the inode chunk.
1488 */ 1488 */
@@ -1592,7 +1592,7 @@ xfs_difree_finobt(
1592 * freed an inode in a previously fully allocated chunk. If not, 1592 * freed an inode in a previously fully allocated chunk. If not,
1593 * something is out of sync. 1593 * something is out of sync.
1594 */ 1594 */
1595 XFS_WANT_CORRUPTED_GOTO(ibtrec->ir_freecount == 1, error); 1595 XFS_WANT_CORRUPTED_GOTO(mp, ibtrec->ir_freecount == 1, error);
1596 1596
1597 error = xfs_inobt_insert_rec(cur, ibtrec->ir_freecount, 1597 error = xfs_inobt_insert_rec(cur, ibtrec->ir_freecount,
1598 ibtrec->ir_free, &i); 1598 ibtrec->ir_free, &i);
@@ -1613,12 +1613,12 @@ xfs_difree_finobt(
1613 error = xfs_inobt_get_rec(cur, &rec, &i); 1613 error = xfs_inobt_get_rec(cur, &rec, &i);
1614 if (error) 1614 if (error)
1615 goto error; 1615 goto error;
1616 XFS_WANT_CORRUPTED_GOTO(i == 1, error); 1616 XFS_WANT_CORRUPTED_GOTO(mp, i == 1, error);
1617 1617
1618 rec.ir_free |= XFS_INOBT_MASK(offset); 1618 rec.ir_free |= XFS_INOBT_MASK(offset);
1619 rec.ir_freecount++; 1619 rec.ir_freecount++;
1620 1620
1621 XFS_WANT_CORRUPTED_GOTO((rec.ir_free == ibtrec->ir_free) && 1621 XFS_WANT_CORRUPTED_GOTO(mp, (rec.ir_free == ibtrec->ir_free) &&
1622 (rec.ir_freecount == ibtrec->ir_freecount), 1622 (rec.ir_freecount == ibtrec->ir_freecount),
1623 error); 1623 error);
1624 1624