Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[pandora-kernel.git] / fs / jffs2 / acl.c
index d987137..043740d 100644 (file)
@@ -38,12 +38,12 @@ static int jffs2_acl_count(size_t size)
        size_t s;
 
        size -= sizeof(struct jffs2_acl_header);
-       s = size - 4 * sizeof(struct jffs2_acl_entry_short);
-       if (s < 0) {
+       if (size < 4 * sizeof(struct jffs2_acl_entry_short)) {
                if (size % sizeof(struct jffs2_acl_entry_short))
                        return -1;
                return size / sizeof(struct jffs2_acl_entry_short);
        } else {
+               s = size - 4 * sizeof(struct jffs2_acl_entry_short);
                if (s % sizeof(struct jffs2_acl_entry))
                        return -1;
                return s / sizeof(struct jffs2_acl_entry) + 4;
@@ -336,7 +336,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
                return PTR_ERR(acl);
 
        if (!acl) {
-               *i_mode &= ~current->fs->umask;
+               *i_mode &= ~current_umask();
        } else {
                if (S_ISDIR(*i_mode))
                        jffs2_iset_acl(inode, &f->i_acl_default, acl);