summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/inode.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-11-06 11:46:15 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-09 09:10:45 -0800
commit0a1e1567b386b96c710d385181330c13ca03ffe3 (patch)
tree957b4f93ef93372b595f48f45a7b5c22f144fbe9 /fs/xfs/scrub/inode.c
parent35ce85233412354d6737b8407738174eb251fd32 (diff)
xfs: pass inode number to xfs_scrub_ino_set_{preen,warning}
There are two ways to scrub an inode -- calling xfs_iget and checking the raw inode core, or by loading the inode cluster buffer and checking the on-disk contents directly. The second method is only useful if _iget fails the verifiers; when this is the case, sc->ip is NULL and calling the tracepoint will cause a system crash. Therefore, pass the raw inode number directly into the _preen and _warning functions. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/inode.c')
-rw-r--r--fs/xfs/scrub/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index f275dd25264e..637b7a892313 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -328,7 +328,7 @@ xfs_scrub_dinode(
* We autoconvert v1 inodes into v2 inodes on writeout,
* so just mark this inode for preening.
*/
- xfs_scrub_ino_set_preen(sc, bp);
+ xfs_scrub_ino_set_preen(sc, ino, bp);
break;
case 2:
case 3:
@@ -353,7 +353,7 @@ xfs_scrub_dinode(
*/
if (dip->di_uid == cpu_to_be32(-1U) ||
dip->di_gid == cpu_to_be32(-1U))
- xfs_scrub_ino_set_warning(sc, bp);
+ xfs_scrub_ino_set_warning(sc, ino, bp);
/* di_format */
switch (dip->di_format) {
@@ -408,7 +408,7 @@ xfs_scrub_dinode(
* overly large offsets, flag the inode for admin review.
*/
if (isize >= mp->m_super->s_maxbytes)
- xfs_scrub_ino_set_warning(sc, bp);
+ xfs_scrub_ino_set_warning(sc, ino, bp);
/* di_nblocks */
if (flags2 & XFS_DIFLAG2_REFLINK) {
@@ -601,7 +601,7 @@ xfs_scrub_inode(
XFS_INO_TO_AGBNO(mp, ino), &error))
goto out;
if (!has_shared)
- xfs_scrub_ino_set_preen(sc, bp);
+ xfs_scrub_ino_set_preen(sc, ino, bp);
}
out: