Commit 68d1498c authored by Russell Cattelan's avatar Russell Cattelan Committed by Christoph Hellwig

[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: default avatarRussell Cattelan <cattelan@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@sgi.com>
parent 25128092
...@@ -278,7 +278,9 @@ xfs_iomap( ...@@ -278,7 +278,9 @@ xfs_iomap(
switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) { switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) {
case BMAPI_WRITE: case BMAPI_WRITE:
/* If we found an extent, return it */ /* 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, xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, io,
offset, count, iomapp, &imap, flags); offset, count, iomapp, &imap, flags);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment