Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Jan Kara 17dc59ba bff943af

+2 -2
+2 -2
fs/udf/truncate.c
··· 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 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);