[XFS] fix uninitialised variable bug in dquot release.
[deliverable/linux.git] / fs / xfs / linux-2.6 / xfs_ioctl.c
index 48799ba7e3e6f2ded6a46e972a254044c76bb83d..f1bd6c36e6fe57eafe9259130a71722e38fd6c9e 100644 (file)
@@ -311,11 +311,10 @@ xfs_open_by_handle(
                return new_fd;
        }
 
-       dentry = d_alloc_anon(inode);
-       if (dentry == NULL) {
-               iput(inode);
+       dentry = d_obtain_alias(inode);
+       if (IS_ERR(dentry)) {
                put_unused_fd(new_fd);
-               return -XFS_ERROR(ENOMEM);
+               return PTR_ERR(dentry);
        }
 
        /* Ensure umount returns EBUSY on umounts while this file is open. */
@@ -692,8 +691,7 @@ xfs_ioc_space(
        if (ioflags & IO_INVIS)
                attr_flags |= XFS_ATTR_DMI;
 
-       error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos,
-                                             NULL, attr_flags);
+       error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, attr_flags);
        return -error;
 }
 
@@ -1008,7 +1006,7 @@ xfs_ioctl_setattr(
         * to the file owner ID, except in cases where the
         * CAP_FSETID capability is applicable.
         */
-       if (current->fsuid != ip->i_d.di_uid && !capable(CAP_FOWNER)) {
+       if (current_fsuid() != ip->i_d.di_uid && !capable(CAP_FOWNER)) {
                code = XFS_ERROR(EPERM);
                goto error_return;
        }
@@ -1105,10 +1103,6 @@ xfs_ioctl_setattr(
 
        /*
         * Change file ownership.  Must be the owner or privileged.
-        * If the system was configured with the "restricted_chown"
-        * option, the owner is not permitted to give away the file,
-        * and can change the group id only to a group of which he
-        * or she is a member.
         */
        if (mask & FSX_PROJID) {
                /*
This page took 0.035533 seconds and 5 git commands to generate.