diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 995ac16102a9..c4d6f19faf37 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2168,6 +2168,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, | |||
2168 | newblock = iblock - ee_block + ext_pblock(ex); | 2168 | newblock = iblock - ee_block + ext_pblock(ex); |
2169 | ex2 = ex; | 2169 | ex2 = ex; |
2170 | 2170 | ||
2171 | err = ext4_ext_get_access(handle, inode, path + depth); | ||
2172 | if (err) | ||
2173 | goto out; | ||
2174 | |||
2171 | /* ex1: ee_block to iblock - 1 : uninitialized */ | 2175 | /* ex1: ee_block to iblock - 1 : uninitialized */ |
2172 | if (iblock > ee_block) { | 2176 | if (iblock > ee_block) { |
2173 | ex1 = ex; | 2177 | ex1 = ex; |
@@ -2210,6 +2214,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, | |||
2210 | ex = path[depth].p_ext; | 2214 | ex = path[depth].p_ext; |
2211 | if (ex2 != &newex) | 2215 | if (ex2 != &newex) |
2212 | ex2 = ex; | 2216 | ex2 = ex; |
2217 | |||
2218 | err = ext4_ext_get_access(handle, inode, path + depth); | ||
2219 | if (err) | ||
2220 | goto out; | ||
2213 | } | 2221 | } |
2214 | allocated = max_blocks; | 2222 | allocated = max_blocks; |
2215 | } | 2223 | } |
@@ -2230,9 +2238,6 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, | |||
2230 | ex2->ee_len = cpu_to_le16(allocated); | 2238 | ex2->ee_len = cpu_to_le16(allocated); |
2231 | if (ex2 != ex) | 2239 | if (ex2 != ex) |
2232 | goto insert; | 2240 | goto insert; |
2233 | err = ext4_ext_get_access(handle, inode, path + depth); | ||
2234 | if (err) | ||
2235 | goto out; | ||
2236 | /* | 2241 | /* |
2237 | * New (initialized) extent starts from the first block | 2242 | * New (initialized) extent starts from the first block |
2238 | * in the current extent. i.e., ex2 == ex | 2243 | * in the current extent. i.e., ex2 == ex |