mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
udf: add assertions
Add a few assertions into udf_discard_prealloc() to check that the file is sane (mostly helps debugging further patches ;). Signed-off-by: Jan Kara <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3bf25cb40d
commit
948b9b2c96
1 changed files with 3 additions and 1 deletions
|
|
@ -88,8 +88,9 @@ void udf_discard_prealloc(struct inode * inode)
|
|||
{
|
||||
etype = netype;
|
||||
lbcount += elen;
|
||||
if (lbcount > inode->i_size && lbcount - inode->i_size < inode->i_sb->s_blocksize)
|
||||
if (lbcount > inode->i_size && lbcount - elen < inode->i_size)
|
||||
{
|
||||
WARN_ON(lbcount - inode->i_size >= inode->i_sb->s_blocksize);
|
||||
nelen = elen - (lbcount - inode->i_size);
|
||||
epos.offset -= adsize;
|
||||
extent_trunc(inode, &epos, eloc, etype, elen, nelen);
|
||||
|
|
@ -119,6 +120,7 @@ void udf_discard_prealloc(struct inode * inode)
|
|||
}
|
||||
UDF_I_LENEXTENTS(inode) = lbcount;
|
||||
|
||||
WARN_ON(lbcount != inode->i_size);
|
||||
brelse(epos.bh);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue