From: Russell Cattelan <cattelan@sgi.com> Date: Fri, 6 May 2005 13:42:22 +0000 (-0700) Subject: [XFS] Fix a bug in xfs_iomap for extent handling of write cases X-Git-Tag: firefly_0821_release~42717^2~279^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=68d1498c3a7e5223b587ad067111fbed12df52a1;p=firefly-linux-kernel-4.4.55.git [XFS] Fix a bug in xfs_iomap for extent handling of write cases This may be the cause of several open PV's of incorrect delay flags being set and then tripping asserts. Do not return a delay alloc extent when the caller is asking to do a write. SGI Modid: xfs-linux:xfs-kern:189616a Signed-off-by: Russell Cattelan <cattelan@sgi.com> Signed-off-by: Christoph Hellwig <hch@sgi.com> --- diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 991f8a61f7c4..469e1a7939d4 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -278,7 +278,9 @@ phase2: switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) { case BMAPI_WRITE: /* If we found an extent, return it */ - if (nimaps && (imap.br_startblock != HOLESTARTBLOCK)) { + if (nimaps && + (imap.br_startblock != HOLESTARTBLOCK) && + (imap.br_startblock != DELAYSTARTBLOCK)) { xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, io, offset, count, iomapp, &imap, flags); break;