diff --git a/lustre/kernel_patches/patches/nfs_statfs-toomanyfiles-rhel-2.4.patch b/lustre/kernel_patches/patches/nfs_statfs-toomanyfiles-rhel-2.4.patch
new file mode 100644
index 0000000000000000000000000000000000000000..4bb889239488d77088050b5cbdd1f663c5152f1f
--- /dev/null
+++ b/lustre/kernel_patches/patches/nfs_statfs-toomanyfiles-rhel-2.4.patch
@@ -0,0 +1,30 @@
+Index: linux-2.4.21/fs/nfs/inode.c
+===================================================================
+--- linux-2.4.21.orig/fs/nfs/inode.c	2005-06-01 22:51:55.000000000 -0400
++++ linux-2.4.21/fs/nfs/inode.c	2005-06-01 23:38:54.883239912 -0400
+@@ -679,14 +679,21 @@
+ 		goto too_big;
+ 	if (TOOBIG(((res.abytes + blockres) >> blockbits)))
+ 		goto too_big;
+-	if (TOOBIG(res.tfiles) || TOOBIG(res.afiles))
+-		goto too_big;
+ 
+ 	buf->f_blocks = (res.tbytes + blockres) >> blockbits;
+ 	buf->f_bfree = (res.fbytes + blockres) >> blockbits;
+ 	buf->f_bavail = (res.abytes + blockres) >> blockbits;
+-	buf->f_files = res.tfiles;
+-	buf->f_ffree = res.afiles;
++
++	if (TOOBIG(res.tfiles))
++		buf->f_files = -1;
++	else
++		buf->f_files = res.tfiles;
++
++	if (TOOBIG(res.afiles))
++		buf->f_ffree = -1;
++	else
++		buf->f_ffree = res.afiles;
++
+ 	return 0;
+ 
+  too_big:
diff --git a/lustre/kernel_patches/patches/statfs64-cast-unsigned-2.4-rhel.patch b/lustre/kernel_patches/patches/statfs64-cast-unsigned-2.4-rhel.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a1063ae6f4e959a0fb857cd4d02965734a3d3e20
--- /dev/null
+++ b/lustre/kernel_patches/patches/statfs64-cast-unsigned-2.4-rhel.patch
@@ -0,0 +1,28 @@
+Index: linux-2.4.21/fs/open.c
+===================================================================
+--- linux-2.4.21.orig/fs/open.c	2005-05-04 16:09:11.702098704 -0400
++++ linux-2.4.21/fs/open.c	2005-05-04 16:17:31.597103112 -0400
+@@ -92,15 +92,15 @@
+ 		if (retval)
+ 			return retval;
+ 		/* Stuff the 32 bit values into the 64 bit struct */
+-		buf->f_type = st.f_type;
+-		buf->f_bsize = st.f_bsize;
+-		buf->f_blocks = st.f_blocks;
+-		buf->f_bfree = st.f_bfree;
+-		buf->f_bavail = st.f_bavail;
+-		buf->f_files = st.f_files;
+-		buf->f_ffree = st.f_ffree;
++		buf->f_type = (unsigned long) st.f_type;
++		buf->f_bsize = (unsigned long) st.f_bsize;
++		buf->f_blocks = (unsigned long) st.f_blocks;
++		buf->f_bfree = (unsigned long) st.f_bfree;
++		buf->f_bavail = (unsigned long) st.f_bavail;
++		buf->f_files = (unsigned long) st.f_files;
++		buf->f_ffree = (unsigned long) st.f_ffree;
+ 		buf->f_fsid = st.f_fsid;
+-		buf->f_namelen = st.f_namelen;
++		buf->f_namelen = (unsigned long) st.f_namelen;
+ 		memset(buf->f_spare, 0, sizeof(buf->f_spare));
+ 	}
+ 	return 0;