vserver 1.9.5.x5
[linux-2.6.git] / fs / xfs / linux-2.6 / xfs_ioctl.c
index f29c510..c1682ce 100644 (file)
@@ -270,7 +270,7 @@ xfs_vget_fsop_handlereq(
        /*
         * Get the XFS inode, building a vnode to go with it.
         */
-       error = xfs_iget(mp, NULL, ino, XFS_ILOCK_SHARED, &ip, 0);
+       error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
        if (error)
                return error;
        if (ip == NULL)
@@ -499,7 +499,7 @@ xfs_attrmulti_by_handle(
        xfs_fsop_attrmulti_handlereq_t am_hreq;
        struct inode            *inode;
        vnode_t                 *vp;
-       int                     i, size;
+       unsigned int            i, size;
 
        error = xfs_vget_fsop_handlereq(mp, parinode, CAP_SYS_ADMIN, arg,
                                        sizeof(xfs_fsop_attrmulti_handlereq_t),
@@ -509,6 +509,11 @@ xfs_attrmulti_by_handle(
                return -error;
 
        size = am_hreq.opcount * sizeof(attr_multiop_t);
+       if (!size || size > 16 * PAGE_SIZE) {
+               VN_RELE(vp);
+               return -XFS_ERROR(E2BIG);
+       }
+
        ops = (xfs_attr_multiop_t *)kmalloc(size, GFP_KERNEL);
        if (!ops) {
                VN_RELE(vp);
@@ -1009,7 +1014,7 @@ xfs_ioc_fsgeometry(
 #define LINUX_XFLAG_NODUMP     0x00000040 /* do not dump file */
 #define LINUX_XFLAG_NOATIME    0x00000080 /* do not update atime */
 #define LINUX_XFLAG_BARRIER    0x00004000 /* chroot() barrier */
-#define LINUX_XFLAG_IUNLINK    0x00008000 /* Immutable unlink */
+#define LINUX_XFLAG_IUNLINK    0x00008000 /* immutable unlink */
 
 STATIC unsigned int
 xfs_merge_ioc_xflags(