aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/inode.c
diff options
context:
space:
mode:
authorVladimir V. Saveliev <vs@namesys.com>2006-03-02 05:54:39 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-02 11:33:08 -0500
commitc499ec24c31edf270e777a868ffd0daddcfe7ebd (patch)
treebf16f601b5446bb0b9fe3f90030a76ac4e25fc11 /fs/reiserfs/inode.c
parenta57ebfdb2cf9fa60dfa2f403f70ef6c432ca2a62 (diff)
[PATCH] reiserfs: do not check if unsigned < 0
This patch fixes bugs in reiserfs where unsigned integers were checked whether they are less then 0. Signed-off-by: Vladimir V. Saveliev <vs@namesys.com> Cc: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Hans Reiser <reiser@namesys.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r--fs/reiserfs/inode.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index b33d67bba2fd..d60f6238c66a 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -627,11 +627,6 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
627 reiserfs_write_lock(inode->i_sb); 627 reiserfs_write_lock(inode->i_sb);
628 version = get_inode_item_key_version(inode); 628 version = get_inode_item_key_version(inode);
629 629
630 if (block < 0) {
631 reiserfs_write_unlock(inode->i_sb);
632 return -EIO;
633 }
634
635 if (!file_capable(inode, block)) { 630 if (!file_capable(inode, block)) {
636 reiserfs_write_unlock(inode->i_sb); 631 reiserfs_write_unlock(inode->i_sb);
637 return -EFBIG; 632 return -EFBIG;
@@ -934,12 +929,13 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
934 //pos_in_item * inode->i_sb->s_blocksize, 929 //pos_in_item * inode->i_sb->s_blocksize,
935 TYPE_INDIRECT, 3); // key type is unimportant 930 TYPE_INDIRECT, 3); // key type is unimportant
936 931
932 RFALSE(cpu_key_k_offset(&tmp_key) > cpu_key_k_offset(&key),
933 "green-805: invalid offset");
937 blocks_needed = 934 blocks_needed =
938 1 + 935 1 +
939 ((cpu_key_k_offset(&key) - 936 ((cpu_key_k_offset(&key) -
940 cpu_key_k_offset(&tmp_key)) >> inode->i_sb-> 937 cpu_key_k_offset(&tmp_key)) >> inode->i_sb->
941 s_blocksize_bits); 938 s_blocksize_bits);
942 RFALSE(blocks_needed < 0, "green-805: invalid offset");
943 939
944 if (blocks_needed == 1) { 940 if (blocks_needed == 1) {
945 un = &unf_single; 941 un = &unf_single;