diff options
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index cae8ae3c1746..be0b1b3eed97 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2076,8 +2076,18 @@ static int ext4_fill_fiemap_extents(struct inode *inode, | |||
2076 | break; | 2076 | break; |
2077 | } | 2077 | } |
2078 | 2078 | ||
2079 | /* This is possible iff next == next_del == EXT_MAX_BLOCKS */ | 2079 | /* |
2080 | if (next == next_del) { | 2080 | * This is possible iff next == next_del == EXT_MAX_BLOCKS. |
2081 | * we need to check next == EXT_MAX_BLOCKS because it is | ||
2082 | * possible that an extent is with unwritten and delayed | ||
2083 | * status due to when an extent is delayed allocated and | ||
2084 | * is allocated by fallocate status tree will track both of | ||
2085 | * them in a extent. | ||
2086 | * | ||
2087 | * So we could return a unwritten and delayed extent, and | ||
2088 | * its block is equal to 'next'. | ||
2089 | */ | ||
2090 | if (next == next_del && next == EXT_MAX_BLOCKS) { | ||
2081 | flags |= FIEMAP_EXTENT_LAST; | 2091 | flags |= FIEMAP_EXTENT_LAST; |
2082 | if (unlikely(next_del != EXT_MAX_BLOCKS || | 2092 | if (unlikely(next_del != EXT_MAX_BLOCKS || |
2083 | next != EXT_MAX_BLOCKS)) { | 2093 | next != EXT_MAX_BLOCKS)) { |
@@ -3522,9 +3532,9 @@ out: | |||
3522 | * | 3532 | * |
3523 | * Return 1 if there is a delalloc block in the range, otherwise 0. | 3533 | * Return 1 if there is a delalloc block in the range, otherwise 0. |
3524 | */ | 3534 | */ |
3525 | static int ext4_find_delalloc_range(struct inode *inode, | 3535 | int ext4_find_delalloc_range(struct inode *inode, |
3526 | ext4_lblk_t lblk_start, | 3536 | ext4_lblk_t lblk_start, |
3527 | ext4_lblk_t lblk_end) | 3537 | ext4_lblk_t lblk_end) |
3528 | { | 3538 | { |
3529 | struct extent_status es; | 3539 | struct extent_status es; |
3530 | 3540 | ||