aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/truncate.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2007-01-29 16:19:55 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-30 11:26:45 -0500
commit8682164a66325cab07620082eb7f413b547f4b4a (patch)
treec8e7b5456a71b58506b182ffa0997271d8ec03fa /fs/ufs/truncate.c
parenta685e26fff387db350966f88eaad515bf41c4705 (diff)
[PATCH] ufs: truncate negative to unsigned fix
During ufs_trunc_direct which is subroutine of ufs::truncate, we try the first 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 can got report that you have free 32T on 1Gb partition. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ufs/truncate.c')
-rw-r--r--fs/ufs/truncate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index ea11d04c41a0..0437b0a6fe97 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -109,10 +109,10 @@ static int ufs_trunc_direct (struct inode * inode)
109 tmp = fs32_to_cpu(sb, *p); 109 tmp = fs32_to_cpu(sb, *p);
110 if (!tmp ) 110 if (!tmp )
111 ufs_panic (sb, "ufs_trunc_direct", "internal error"); 111 ufs_panic (sb, "ufs_trunc_direct", "internal error");
112 frag2 -= frag1;
112 frag1 = ufs_fragnum (frag1); 113 frag1 = ufs_fragnum (frag1);
113 frag2 = ufs_fragnum (frag2);
114 114
115 ufs_free_fragments (inode, tmp + frag1, frag2 - frag1); 115 ufs_free_fragments(inode, tmp + frag1, frag2);
116 mark_inode_dirty(inode); 116 mark_inode_dirty(inode);
117 frag_to_free = tmp + frag1; 117 frag_to_free = tmp + frag1;
118 118