Skip to contentSkip to conversation

Bug in UDF, setting larger file size when data in ICB

DISCUSSION Ian Abbott 2 participants 3 messages Jul 23, 2012 – Aug 14, 2012

lore
Share & tools
lore

Ian Abbott

author
#0 lore raw

Hi folks,

in fs/udf/inode.c, udf_setsize(), if the new size is larger than the old size and the old data is in the ICB and the new size still fits in the ICB (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB and iinfo->i_lenAlloc = newsize), udf_extend_file() is called which promptly calls BUG() because it does not like this i_alloc_type value.

I think the simplest fix would be to add a 'goto' after the assignment to iinfo->i_lenAlloc, bypassing the call to udf_extend_file().

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
author
#1 lore raw
Quoted 10 lines · Ian Abbott

Hi folks,

in fs/udf/inode.c, udf_setsize(), if the new size is larger than the old size and the old data is in the ICB and the new size still fits in the ICB (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB and iinfo->i_lenAlloc = newsize), udf_extend_file() is called which promptly calls BUG() because it does not like this i_alloc_type value.

I think the simplest fix would be to add a 'goto' after the assignment to iinfo->i_lenAlloc, bypassing the call to udf_extend_file().

Jan is on vacation until early August, so I submitted my own patch:

Date: Mon, 23 Jul 2012 17:39:29 +0100
Subject: [PATCH] udf: fix udf_setsize() for file data in ICB
Message-ID: <[email protected]>

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
#2 lore raw
Quoted 9 lines · Ian Abbott
Quoted 8 lines · Ian Abbott

Hi folks,

in fs/udf/inode.c, udf_setsize(), if the new size is larger than the old size and the old data is in the ICB and the new size still fits in the ICB (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB and iinfo->i_lenAlloc = newsize), udf_extend_file() is called which promptly calls BUG() because it does not like this i_alloc_type value.

Quoted 8 lines
Quoted 2 lines

I think the simplest fix would be to add a 'goto' after the assignment to iinfo->i_lenAlloc, bypassing the call to udf_extend_file().

Jan is on vacation until early August, so I submitted my own patch:

Date: Mon, 23 Jul 2012 17:39:29 +0100
Subject: [PATCH] udf: fix udf_setsize() for file data in ICB
Message-ID: <[email protected]>

Thanks for the patch. I've added it to my tree and will send it to Linus
soon.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR