Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=948b9b2c967c3bec6136b2dbb9e1c12f62e03efa
Commit:     948b9b2c967c3bec6136b2dbb9e1c12f62e03efa
Parent:     3bf25cb40d899eeb5a471f497e56ddfe2c96c019
Author:     Jan Kara <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:35:18 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:21 2007 -0700

    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]>
---
 fs/udf/truncate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index 0449b22..0e328cd 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -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);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to