aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 18:18:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-24 10:12:01 -0400
commit963945bf93e46b9bf71a07bf9c78183e0f57733a (patch)
tree736c84e9a31b2dd736293ca117688527e3a5a194
parent1ec95bf34d976b38897d1977b155a544d77b05e7 (diff)
fix jffs2 ACLs on big-endian with 16bit mode_t
casting int * to mode_t * is not a good thing - on a *lot* of big-endian architectures mode_t happens to be smaller than int and there it breaks quite spectaculary... Fucked-up-by: commit cfc8dc6f6f69ede939e09c2af06a01adee577285 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/jffs2/acl.c4
-rw-r--r--fs/jffs2/acl.h2
-rw-r--r--fs/jffs2/fs.c2
-rw-r--r--fs/jffs2/os-linux.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 3675b3cdee89..f9c302430aa1 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -278,7 +278,7 @@ int jffs2_check_acl(struct inode *inode, int mask)
278 return -EAGAIN; 278 return -EAGAIN;
279} 279}
280 280
281int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode) 281int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
282{ 282{
283 struct posix_acl *acl, *clone; 283 struct posix_acl *acl, *clone;
284 int rc; 284 int rc;
@@ -301,7 +301,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
301 clone = posix_acl_clone(acl, GFP_KERNEL); 301 clone = posix_acl_clone(acl, GFP_KERNEL);
302 if (!clone) 302 if (!clone)
303 return -ENOMEM; 303 return -ENOMEM;
304 rc = posix_acl_create_masq(clone, (mode_t *)i_mode); 304 rc = posix_acl_create_masq(clone, i_mode);
305 if (rc < 0) { 305 if (rc < 0) {
306 posix_acl_release(clone); 306 posix_acl_release(clone);
307 return rc; 307 return rc;
diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h
index 5e42de8d9541..9973073b9c47 100644
--- a/fs/jffs2/acl.h
+++ b/fs/jffs2/acl.h
@@ -28,7 +28,7 @@ struct jffs2_acl_header {
28 28
29extern int jffs2_check_acl(struct inode *, int); 29extern int jffs2_check_acl(struct inode *, int);
30extern int jffs2_acl_chmod(struct inode *); 30extern int jffs2_acl_chmod(struct inode *);
31extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *); 31extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *);
32extern int jffs2_init_acl_post(struct inode *); 32extern int jffs2_init_acl_post(struct inode *);
33 33
34extern const struct xattr_handler jffs2_acl_access_xattr_handler; 34extern const struct xattr_handler jffs2_acl_access_xattr_handler;
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 46ad619b6124..eeead33d8ef0 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
406 406
407/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, 407/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash,
408 fill in the raw_inode while you're at it. */ 408 fill in the raw_inode while you're at it. */
409struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri) 409struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri)
410{ 410{
411 struct inode *inode; 411 struct inode *inode;
412 struct super_block *sb = dir_i->i_sb; 412 struct super_block *sb = dir_i->i_sb;
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 9c252835e8e5..526979c607b6 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *);
173struct inode *jffs2_iget(struct super_block *, unsigned long); 173struct inode *jffs2_iget(struct super_block *, unsigned long);
174void jffs2_evict_inode (struct inode *); 174void jffs2_evict_inode (struct inode *);
175void jffs2_dirty_inode(struct inode *inode, int flags); 175void jffs2_dirty_inode(struct inode *inode, int flags);
176struct inode *jffs2_new_inode (struct inode *dir_i, int mode, 176struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode,
177 struct jffs2_raw_inode *ri); 177 struct jffs2_raw_inode *ri);
178int jffs2_statfs (struct dentry *, struct kstatfs *); 178int jffs2_statfs (struct dentry *, struct kstatfs *);
179int jffs2_remount_fs (struct super_block *, int *, char *); 179int jffs2_remount_fs (struct super_block *, int *, char *);