From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: [PATCH] udf: Do not decrement i_blocks when freeing indirect extent block Date: Mon, 9 Jul 2012 23:43:12 +0200 Message-ID: <1341870192-11693-1-git-send-email-jack@suse.cz> Cc: Jan Kara To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:58688 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754106Ab2GIVnP (ORCPT ); Mon, 9 Jul 2012 17:43:15 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A7132A0FF5 for ; Mon, 9 Jul 2012 23:43:14 +0200 (CEST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 Signed-off-by: Jan Kara --- fs/udf/truncate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) I have queued this UDF fix to my tree and plan to send it to Linus in the next merge window. diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c index 4b98fee..8a9657d 100644 --- a/fs/udf/truncate.c +++ b/fs/udf/truncate.c @@ -248,7 +248,7 @@ void udf_truncate_extents(struct inode *inode) /* We managed to free all extents in the * indirect extent - free it too */ BUG_ON(!epos.bh); - udf_free_blocks(sb, inode, &epos.block, + udf_free_blocks(sb, NULL, &epos.block, 0, indirect_ext_len); } else if (!epos.bh) { iinfo->i_lenAlloc = lenalloc; @@ -275,7 +275,7 @@ void udf_truncate_extents(struct inode *inode) if (indirect_ext_len) { 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) { iinfo->i_lenAlloc = lenalloc; mark_inode_dirty(inode); -- 1.7.1