Commit 963945bf authored by Al Viro's avatar Al Viro

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 cfc8dc6fSigned-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1ec95bf3
...@@ -278,7 +278,7 @@ int jffs2_check_acl(struct inode *inode, int mask) ...@@ -278,7 +278,7 @@ int jffs2_check_acl(struct inode *inode, int mask)
return -EAGAIN; return -EAGAIN;
} }
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode) int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
{ {
struct posix_acl *acl, *clone; struct posix_acl *acl, *clone;
int rc; int rc;
...@@ -301,7 +301,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode) ...@@ -301,7 +301,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
clone = posix_acl_clone(acl, GFP_KERNEL); clone = posix_acl_clone(acl, GFP_KERNEL);
if (!clone) if (!clone)
return -ENOMEM; return -ENOMEM;
rc = posix_acl_create_masq(clone, (mode_t *)i_mode); rc = posix_acl_create_masq(clone, i_mode);
if (rc < 0) { if (rc < 0) {
posix_acl_release(clone); posix_acl_release(clone);
return rc; return rc;
......
...@@ -28,7 +28,7 @@ struct jffs2_acl_header { ...@@ -28,7 +28,7 @@ struct jffs2_acl_header {
extern int jffs2_check_acl(struct inode *, int); extern int jffs2_check_acl(struct inode *, int);
extern int jffs2_acl_chmod(struct inode *); extern int jffs2_acl_chmod(struct inode *);
extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *); extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *);
extern int jffs2_init_acl_post(struct inode *); extern int jffs2_init_acl_post(struct inode *);
extern const struct xattr_handler jffs2_acl_access_xattr_handler; extern const struct xattr_handler jffs2_acl_access_xattr_handler;
......
...@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) ...@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash,
fill in the raw_inode while you're at it. */ fill in the raw_inode while you're at it. */
struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri) struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri)
{ {
struct inode *inode; struct inode *inode;
struct super_block *sb = dir_i->i_sb; struct super_block *sb = dir_i->i_sb;
......
...@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *); ...@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *);
struct inode *jffs2_iget(struct super_block *, unsigned long); struct inode *jffs2_iget(struct super_block *, unsigned long);
void jffs2_evict_inode (struct inode *); void jffs2_evict_inode (struct inode *);
void jffs2_dirty_inode(struct inode *inode, int flags); void jffs2_dirty_inode(struct inode *inode, int flags);
struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode,
struct jffs2_raw_inode *ri); struct jffs2_raw_inode *ri);
int jffs2_statfs (struct dentry *, struct kstatfs *); int jffs2_statfs (struct dentry *, struct kstatfs *);
int jffs2_remount_fs (struct super_block *, int *, char *); int jffs2_remount_fs (struct super_block *, int *, char *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment