[2/6] xfs: add missing assert in xfs_fsmap_owner_from_rmap
diff mbox series

Message ID 157281985693.4151907.15767461539661066081.stgit@magnolia
State New
Headers show
Series
  • xfs: refactor corruption checking and reporting
Related show

Commit Message

Darrick J. Wong Nov. 3, 2019, 10:24 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

The fsmap handler shouldn't fail silently if the rmap code ever feeds it
a special owner number that isn't known to the fsmap handler.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_fsmap.c |    1 +
 1 file changed, 1 insertion(+)

Comments

hch@infradead.org Nov. 5, 2019, 12:44 a.m. UTC | #1
On Sun, Nov 03, 2019 at 02:24:16PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The fsmap handler shouldn't fail silently if the rmap code ever feeds it
> a special owner number that isn't known to the fsmap handler.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
index d082143feb5a..918456ca29e1 100644
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -146,6 +146,7 @@  xfs_fsmap_owner_from_rmap(
 		dest->fmr_owner = XFS_FMR_OWN_FREE;
 		break;
 	default:
+		ASSERT(0);
 		return -EFSCORRUPTED;
 	}
 	return 0;