Commit 17dc59ba418c3d6b0675d5b74d280acab2d4e369

Authored by Jan Kara
1 parent bff943af6f

udf: Do not decrement i_blocks when freeing indirect extent block

Indirect extent block is not accounted in i_blocks during allocation
thus we should not decrement i_blocks when we are freeing such block
during truncation.

Reported-by: Steve Nickel <snickel58@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -248,7 +248,7 @@
248 248 /* We managed to free all extents in the
249 249 * indirect extent - free it too */
250 250 BUG_ON(!epos.bh);
251   - udf_free_blocks(sb, inode, &epos.block,
  251 + udf_free_blocks(sb, NULL, &epos.block,
252 252 0, indirect_ext_len);
253 253 } else if (!epos.bh) {
254 254 iinfo->i_lenAlloc = lenalloc;
... ... @@ -275,7 +275,7 @@
275 275  
276 276 if (indirect_ext_len) {
277 277 BUG_ON(!epos.bh);
278   - udf_free_blocks(sb, inode, &epos.block, 0, indirect_ext_len);
  278 + udf_free_blocks(sb, NULL, &epos.block, 0, indirect_ext_len);
279 279 } else if (!epos.bh) {
280 280 iinfo->i_lenAlloc = lenalloc;
281 281 mark_inode_dirty(inode);