Skip to content

Commit

Permalink
(try3-resend) Fix nfs_compat_user_ino64 so it doesn't cause problems …
Browse files Browse the repository at this point in the history
…if bit 31 or 63 are set in fileid

The problem was use of an int32, which when converted to a uint64
is sign extended resulting in a fileid that doesn't fit in 32 bits
even though the intent of the function is to fit the fileid into
32 bits.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
[Trond: Added an include for compat.h]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Frank Filz authored and Trond Myklebust committed Mar 10, 2011
1 parent 43b7c3f commit 3fa0b4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/inet.h>
#include <linux/nfs_xdr.h>
#include <linux/slab.h>
#include <linux/compat.h>

#include <asm/system.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -89,7 +90,11 @@ int nfs_wait_bit_killable(void *word)
*/
u64 nfs_compat_user_ino64(u64 fileid)
{
int ino;
#ifdef CONFIG_COMPAT
compat_ulong_t ino;
#else
unsigned long ino;
#endif

if (enable_ino64)
return fileid;
Expand Down

0 comments on commit 3fa0b4e

Please sign in to comment.