xfs_getbmap assert

Christoph Hellwig hch at infradead.org
Mon Nov 7 04:30:37 CST 2011


With Dmitris fsstress updates I can hit the following assert fairly
regularly:

[11904.943956] XFS: Assertion failed: ((iflags & BMV_IF_DELALLOC) != 0) ||
(map[i].br_startblock != DELAYSTARTBLOCK), file:
/home/hch/work/linux-2.6/fs/xfs/xfs_bmap.c, line: 5604

which means we get an delalloc extent back from FIEMAP/GETBMAP despite
asking for a flush beforehand.  While we hold the iolock over the call
and thus exclude new buffered writers from appearing that doesn't
prevent shared writeable mmaps from creating new delalloc extents.

I don't think this actually is a real issue, and a workaround would
be extremly hard.  For now I've just remove the assert in my tree:


Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c	2011-11-05 09:02:24.410021945 +0100
+++ xfs/fs/xfs/xfs_bmap.c	2011-11-05 09:03:54.036494235 +0100
@@ -5600,8 +5600,6 @@ xfs_getbmap(
 				XFS_FSB_TO_BB(mp, map[i].br_blockcount);
 			out[cur_ext].bmv_unused1 = 0;
 			out[cur_ext].bmv_unused2 = 0;
-			ASSERT(((iflags & BMV_IF_DELALLOC) != 0) ||
-			      (map[i].br_startblock != DELAYSTARTBLOCK));
                         if (map[i].br_startblock == HOLESTARTBLOCK &&
 			    whichfork == XFS_ATTR_FORK) {
 				/* came to the end of attribute fork */




More information about the xfs mailing list