Commit:     8682164a66325cab07620082eb7f413b547f4b4a
Parent:     a685e26fff387db350966f88eaad515bf41c4705
Author:     Evgeniy Dushistov <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 29 13:19:55 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 30 08:26:45 2007 -0800

    [PATCH] ufs: truncate negative to unsigned fix
    During ufs_trunc_direct which is subroutine of ufs::truncate, we try the 
    of all free parts of block and then whole blocks.  But we calculate size of
    block's part to free in the wrong way.
    This may cause bad update of used blocks and fragments statistic, and you 
    got report that you have free 32T on 1Gb partition.
    Signed-off-by: Evgeniy Dushistov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/ufs/truncate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index ea11d04..0437b0a 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -109,10 +109,10 @@ static int ufs_trunc_direct (struct inode * inode)
        tmp = fs32_to_cpu(sb, *p);
        if (!tmp )
                ufs_panic (sb, "ufs_trunc_direct", "internal error");
+       frag2 -= frag1;
        frag1 = ufs_fragnum (frag1);
-       frag2 = ufs_fragnum (frag2);
-       ufs_free_fragments (inode, tmp + frag1, frag2 - frag1);
+       ufs_free_fragments(inode, tmp + frag1, frag2);
        frag_to_free = tmp + frag1;
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

Reply via email to