lkml.org 
[lkml]   [2007]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 4/6] UDF cleanup and fixes
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 <jack@suse.cz>

diff -rupX /home/jack/.kerndiffexclude linux-2.6.20-3-udf_buffer_handling/fs/udf/truncate.c linux-2.6.20-4-udf_discard_prealloc_cleanup/fs/udf/truncate.c
--- linux-2.6.20-3-udf_buffer_handling/fs/udf/truncate.c 2007-03-06 15:02:33.000000000 +0100
+++ linux-2.6.20-4-udf_discard_prealloc_cleanup/fs/udf/truncate.c 2007-03-06 15:03:00.000000000 +0100
@@ -88,8 +88,9 @@ void udf_discard_prealloc(struct 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 *
}
UDF_I_LENEXTENTS(inode) = lbcount;

+ WARN_ON(lbcount != inode->i_size);
brelse(epos.bh);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-03-06 17:47    [W:0.247 / U:0.228 seconds]
©2003-2011 Jasper Spaans. Advertise on this site