瀏覽代碼

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 13 年之前
父節點
當前提交
17dc59ba41
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      fs/udf/truncate.c

+ 2 - 2
fs/udf/truncate.c

@@ -248,7 +248,7 @@ void udf_truncate_extents(struct inode *inode)
 				/* We managed to free all extents in the
 				/* We managed to free all extents in the
 				 * indirect extent - free it too */
 				 * indirect extent - free it too */
 				BUG_ON(!epos.bh);
 				BUG_ON(!epos.bh);
-				udf_free_blocks(sb, inode, &epos.block,
+				udf_free_blocks(sb, NULL, &epos.block,
 						0, indirect_ext_len);
 						0, indirect_ext_len);
 			} else if (!epos.bh) {
 			} else if (!epos.bh) {
 				iinfo->i_lenAlloc = lenalloc;
 				iinfo->i_lenAlloc = lenalloc;
@@ -275,7 +275,7 @@ void udf_truncate_extents(struct inode *inode)
 
 
 	if (indirect_ext_len) {
 	if (indirect_ext_len) {
 		BUG_ON(!epos.bh);
 		BUG_ON(!epos.bh);
-		udf_free_blocks(sb, inode, &epos.block, 0, indirect_ext_len);
+		udf_free_blocks(sb, NULL, &epos.block, 0, indirect_ext_len);
 	} else if (!epos.bh) {
 	} else if (!epos.bh) {
 		iinfo->i_lenAlloc = lenalloc;
 		iinfo->i_lenAlloc = lenalloc;
 		mark_inode_dirty(inode);
 		mark_inode_dirty(inode);