[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>
This commit is contained in:
committed by
Linus Torvalds
parent
a57ebfdb2c
commit
c499ec24c3
@@ -1464,13 +1464,11 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
|
||||
partially overwritten pages, if needed. And lock the pages,
|
||||
so that nobody else can access these until we are done.
|
||||
We get number of actual blocks needed as a result. */
|
||||
blocks_to_allocate =
|
||||
reiserfs_prepare_file_region_for_write(inode, pos,
|
||||
num_pages,
|
||||
write_bytes,
|
||||
prepared_pages);
|
||||
if (blocks_to_allocate < 0) {
|
||||
res = blocks_to_allocate;
|
||||
res = reiserfs_prepare_file_region_for_write(inode, pos,
|
||||
num_pages,
|
||||
write_bytes,
|
||||
prepared_pages);
|
||||
if (res < 0) {
|
||||
reiserfs_release_claimed_blocks(inode->i_sb,
|
||||
num_pages <<
|
||||
(PAGE_CACHE_SHIFT -
|
||||
@@ -1478,6 +1476,8 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
|
||||
break;
|
||||
}
|
||||
|
||||
blocks_to_allocate = res;
|
||||
|
||||
/* First we correct our estimate of how many blocks we need */
|
||||
reiserfs_release_claimed_blocks(inode->i_sb,
|
||||
(num_pages <<
|
||||
|
Reference in New Issue
Block a user