[PATCH] fix for locks_verify_truncate

From: Jakub Jelinek (jakub@redhat.com)
Date: Tue May 30 2000 - 03:09:52 EST


Hi!

Using abs for loff_t is not a good idea, abs is declared by gcc as
int abs(int)
so happily stripps off the high bits.
Plus there is no declaration for abs in the linux headers and gcc is not too
happy about it.

--- linux/include/linux/fs.h.jj Mon May 29 10:55:20 2000
+++ linux/include/linux/fs.h Mon May 29 11:42:56 2000
@@ -841,8 +841,8 @@ static inline int locks_verify_truncate(
                 return locks_mandatory_area(
                         FLOCK_VERIFY_WRITE, inode, filp,
                         size < inode->i_size ? size : inode->i_size,
- abs(inode->i_size - size)
- );
+ size < inode->i_size ? inode->i_size - size
+ : size - inode->i_size);
         return 0;
 }
 

        Jakub

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:23 EST