diff options
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 36176018b4b4..f516619a3744 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1127,6 +1127,7 @@ static int ocfs2_check_range_for_holes(struct inode *inode, loff_t pos, | |||
1127 | size_t count) | 1127 | size_t count) |
1128 | { | 1128 | { |
1129 | int ret = 0; | 1129 | int ret = 0; |
1130 | unsigned int extent_flags; | ||
1130 | u32 cpos, clusters, extent_len, phys_cpos; | 1131 | u32 cpos, clusters, extent_len, phys_cpos; |
1131 | struct super_block *sb = inode->i_sb; | 1132 | struct super_block *sb = inode->i_sb; |
1132 | 1133 | ||
@@ -1134,13 +1135,14 @@ static int ocfs2_check_range_for_holes(struct inode *inode, loff_t pos, | |||
1134 | clusters = ocfs2_clusters_for_bytes(sb, pos + count) - cpos; | 1135 | clusters = ocfs2_clusters_for_bytes(sb, pos + count) - cpos; |
1135 | 1136 | ||
1136 | while (clusters) { | 1137 | while (clusters) { |
1137 | ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &extent_len); | 1138 | ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &extent_len, |
1139 | &extent_flags); | ||
1138 | if (ret < 0) { | 1140 | if (ret < 0) { |
1139 | mlog_errno(ret); | 1141 | mlog_errno(ret); |
1140 | goto out; | 1142 | goto out; |
1141 | } | 1143 | } |
1142 | 1144 | ||
1143 | if (phys_cpos == 0) { | 1145 | if (phys_cpos == 0 || (extent_flags & OCFS2_EXT_UNWRITTEN)) { |
1144 | ret = 1; | 1146 | ret = 1; |
1145 | break; | 1147 | break; |
1146 | } | 1148 | } |