This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / ext2 / acl.c
index 89d1df9..74acc78 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
+#include <linux/namei.h> 
 #include "ext2.h"
 #include "xattr.h"
 #include "acl.h"
@@ -291,7 +292,8 @@ ext2_permission(struct inode *inode, int mask, struct nameidata *nd)
        int mode = inode->i_mode;
 
        /* Nobody gets write access to a read-only fs */
-       if ((mask & MAY_WRITE) && IS_RDONLY(inode) &&
+       if ((mask & MAY_WRITE) && (IS_RDONLY(inode) ||
+           (nd && MNT_IS_RDONLY(nd->mnt))) &&
            (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                return -EROFS;
        /* Nobody gets write access to an immutable file */