Skip to content

Commit 963945b

Browse files
author
Al Viro
committed
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 cfc8dc6 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1ec95bf commit 963945b

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎fs/jffs2/acl.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ int jffs2_check_acl(struct inode *inode, int mask)
278278
return -EAGAIN;
279279
}
280280

281-
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
281+
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
282282
{
283283
struct posix_acl *acl, *clone;
284284
int rc;
@@ -301,7 +301,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
301301
clone = posix_acl_clone(acl, GFP_KERNEL);
302302
if (!clone)
303303
return -ENOMEM;
304-
rc = posix_acl_create_masq(clone, (mode_t *)i_mode);
304+
rc = posix_acl_create_masq(clone, i_mode);
305305
if (rc < 0) {
306306
posix_acl_release(clone);
307307
return rc;

‎fs/jffs2/acl.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct jffs2_acl_header {
2828

2929
extern int jffs2_check_acl(struct inode *, int);
3030
extern int jffs2_acl_chmod(struct inode *);
31-
extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *);
31+
extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *);
3232
extern int jffs2_init_acl_post(struct inode *);
3333

3434
extern const struct xattr_handler jffs2_acl_access_xattr_handler;

‎fs/jffs2/fs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
406406

407407
/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash,
408408
fill in the raw_inode while you're at it. */
409-
struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri)
409+
struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri)
410410
{
411411
struct inode *inode;
412412
struct super_block *sb = dir_i->i_sb;

‎fs/jffs2/os-linux.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *);
173173
struct inode *jffs2_iget(struct super_block *, unsigned long);
174174
void jffs2_evict_inode (struct inode *);
175175
void jffs2_dirty_inode(struct inode *inode, int flags);
176-
struct inode *jffs2_new_inode (struct inode *dir_i, int mode,
176+
struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode,
177177
struct jffs2_raw_inode *ri);
178178
int jffs2_statfs (struct dentry *, struct kstatfs *);
179179
int jffs2_remount_fs (struct super_block *, int *, char *);

0 commit comments

Comments
 (0)