This commit was manufactured by cvs2svn to create branch
[linux-2.6.git] / fs / reiserfs / xattr.c
index 7ef7b45..f8babe6 100644 (file)
@@ -1342,7 +1342,7 @@ __reiserfs_permission (struct inode *inode, int mask, struct nameidata *nd,
                /*
                 * Nobody gets write access to a read-only fs.
                 */
-               if (IS_RDONLY(inode) &&
+               if ((IS_RDONLY(inode) || (nd && MNT_IS_RDONLY(nd->mnt))) &&
                    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                        return -EROFS;
 
@@ -1397,7 +1397,9 @@ __reiserfs_permission (struct inode *inode, int mask, struct nameidata *nd,
                 }
 #endif
        } else {
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
 check_groups:
+#endif
                if (in_group_p(inode->i_gid))
                        mode >>= 3;
        }
@@ -1408,7 +1410,9 @@ check_groups:
        if (((mode & mask & (MAY_READ|MAY_WRITE|MAY_EXEC)) == mask))
                return 0;
 
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
 check_capabilities:
+#endif
        /*
         * Read/write DACs are always overridable.
         * Executable DACs are overridable if at least one exec bit is set.