summaryrefslogtreecommitdiff
path: root/fs/ufs/truncate.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-05-26 16:25:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 17:12:33 -0700
commit1d5827235de48e829d5d4a03c3688ef6f2b15562 (patch)
tree96d63baddd6fe6d764557f8be7d4f1e829059792 /fs/ufs/truncate.c
parent9796cc964daf7f18b4cd84c86975b3bc3804ca5a (diff)
ufs: fix truncated values handling 64 bit metadata
Originally i_lastfrag was 32 bits but then we added support for handling 64 bit metadata and it became a 64 bit variable. That was during 2007, in 54fb996ac15c "[PATCH] ufs2 write: block allocation update". Unfortunately these casts got left behind so the value got truncated to 32 bit again. [akpm@linux-foundation.org: remove now-unneeded min_t/max_t casting] Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ufs/truncate.c')
-rw-r--r--fs/ufs/truncate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index 5f821dbc0579..f04f89fbd4d9 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -84,7 +84,7 @@ static int ufs_trunc_direct(struct inode *inode)
retry = 0;
frag1 = DIRECT_FRAGMENT;
- frag4 = min_t(u32, UFS_NDIR_FRAGMENT, ufsi->i_lastfrag);
+ frag4 = min_t(u64, UFS_NDIR_FRAGMENT, ufsi->i_lastfrag);
frag2 = ((frag1 & uspi->s_fpbmask) ? ((frag1 | uspi->s_fpbmask) + 1) : frag1);
frag3 = frag4 & ~uspi->s_fpbmask;
block1 = block2 = 0;