add patch pass-inode-pointer-instead-of-file-pointer-to-punch-hole
[ext4-patch-queue.git] / return-FIEMAP_EXTENT_UNKNOWN-if-an-extent-is-delalloc
blob6fbad2b6e1a0eb154a70f163f280782c7ebdf1a1
1 ext4: return FIEMAP_EXTENT_UNKNOWN for delalloc extents
3 From: Jie Liu <jeff.liu@oracle.com>
5 Return the FIEMAP_EXTENT_UNKNOWN flag as well except the
6 FIEMAP_EXTENT_DELALLOC because the data location of an
7 delayed allocation extent is unknown.
9 Signed-off-by: Jie Liu <jeff.liu@oracle.com>
10 ---
11  fs/ext4/extents.c |    3 ++-
12  1 file changed, 2 insertions(+), 1 deletion(-)
14 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
15 index bc0f191..47e17b1 100644
16 --- a/fs/ext4/extents.c
17 +++ b/fs/ext4/extents.c
18 @@ -2125,7 +2125,8 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
19                 next_del = ext4_find_delayed_extent(inode, &es);
20                 if (!exists && next_del) {
21                         exists = 1;
22 -                       flags |= FIEMAP_EXTENT_DELALLOC;
23 +                       flags |= (FIEMAP_EXTENT_DELALLOC |
24 +                                 FIEMAP_EXTENT_UNKNOWN);
25                 }
26                 up_read(&EXT4_I(inode)->i_data_sem);
28 -- 
29 1.7.9.5