xfs: only clear the suid bit once in xfs_write
[safe/jmp/linux-2.6] / fs / xfs / linux-2.6 / xfs_lrw.c
index c80fa00..eac6f80 100644 (file)
@@ -630,18 +630,9 @@ start:
         * by root.  This keeps people from modifying setuid and
         * setgid binaries.
         */
-
-       if (((xip->i_d.di_mode & S_ISUID) ||
-           ((xip->i_d.di_mode & (S_ISGID | S_IXGRP)) ==
-               (S_ISGID | S_IXGRP))) &&
-            !capable(CAP_FSETID)) {
-               error = xfs_write_clear_setuid(xip);
-               if (likely(!error))
-                       error = -file_remove_suid(file);
-               if (unlikely(error)) {
-                       goto out_unlock_internal;
-               }
-       }
+       error = -file_remove_suid(file);
+       if (unlikely(error))
+               goto out_unlock_internal;
 
        /* We can write back this queue in page reclaim */
        current->backing_dev_info = mapping->backing_dev_info;