[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>

authored by Russell Cattelan and committed by Christoph Hellwig 68d1498c 25128092

+3 -1
+3 -1
fs/xfs/xfs_iomap.c
··· 278 switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) { 279 case BMAPI_WRITE: 280 /* If we found an extent, return it */ 281 - if (nimaps && (imap.br_startblock != HOLESTARTBLOCK)) { 282 xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, io, 283 offset, count, iomapp, &imap, flags); 284 break;
··· 278 switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) { 279 case BMAPI_WRITE: 280 /* If we found an extent, return it */ 281 + if (nimaps && 282 + (imap.br_startblock != HOLESTARTBLOCK) && 283 + (imap.br_startblock != DELAYSTARTBLOCK)) { 284 xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, io, 285 offset, count, iomapp, &imap, flags); 286 break;