This commit was generated by cvs2svn to compensate for changes in r716,
[linux-2.6.git] / fs / stat.c
index f28e994..f180a64 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -14,6 +14,7 @@
 #include <linux/fs.h>
 #include <linux/namei.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -26,6 +27,7 @@ void generic_fillattr(struct inode *inode, struct kstat *stat)
        stat->nlink = inode->i_nlink;
        stat->uid = inode->i_uid;
        stat->gid = inode->i_gid;
+       stat->xid = inode->i_xid;
        stat->rdev = inode->i_rdev;
        stat->atime = inode->i_atime;
        stat->mtime = inode->i_mtime;
@@ -131,6 +133,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
        tmp.st_ino = stat->ino;
        tmp.st_mode = stat->mode;
        tmp.st_nlink = stat->nlink;
+       if (tmp.st_nlink != stat->nlink)
+               return -EOVERFLOW;
        SET_UID(tmp.st_uid, stat->uid);
        SET_GID(tmp.st_gid, stat->gid);
        tmp.st_rdev = old_encode_dev(stat->rdev);
@@ -199,6 +203,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
        tmp.st_ino = stat->ino;
        tmp.st_mode = stat->mode;
        tmp.st_nlink = stat->nlink;
+       if (tmp.st_nlink != stat->nlink)
+               return -EOVERFLOW;
        SET_UID(tmp.st_uid, stat->uid);
        SET_GID(tmp.st_gid, stat->gid);
 #if BITS_PER_LONG == 32