Commit 4251bd1a authored by Linus Torvalds's avatar Linus Torvalds

Merge

parents 2a257ccb c7766898
...@@ -338,9 +338,9 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs) ...@@ -338,9 +338,9 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs)
__asm__ __volatile__("andl %%esp,%0" : __asm__ __volatile__("andl %%esp,%0" :
"=r" (esp) : "0" (8191)); "=r" (esp) : "0" (8191));
if (unlikely(esp < (sizeof(struct task_struct) + 1024))) { if (unlikely(esp < (sizeof(struct thread_info) + 1024))) {
printk("do_IRQ: stack overflow: %ld\n", printk("do_IRQ: stack overflow: %ld\n",
esp - sizeof(struct task_struct)); esp - sizeof(struct thread_info));
dump_stack(); dump_stack();
} }
} }
......
...@@ -2911,7 +2911,11 @@ static void redo_fd_request(void) ...@@ -2911,7 +2911,11 @@ static void redo_fd_request(void)
for (;;) { for (;;) {
if (!current_req) { if (!current_req) {
struct request *req = elv_next_request(&floppy_queue); struct request *req;
spin_lock_irq(floppy_queue.queue_lock);
req = elv_next_request(&floppy_queue);
spin_unlock_irq(floppy_queue.queue_lock);
if (!req) { if (!req) {
do_floppy = NULL; do_floppy = NULL;
unlock_fdc(); unlock_fdc();
......
...@@ -305,6 +305,7 @@ static dev_link_t *tc574_attach(void) ...@@ -305,6 +305,7 @@ static dev_link_t *tc574_attach(void)
link = &lp->link; dev = &lp->dev; link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp; link->priv = dev->priv = link->irq.Instance = lp;
init_timer(&link->release);
link->release.function = &tc574_release; link->release.function = &tc574_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->io.NumPorts1 = 32; link->io.NumPorts1 = 32;
......
...@@ -229,6 +229,7 @@ static dev_link_t *tc589_attach(void) ...@@ -229,6 +229,7 @@ static dev_link_t *tc589_attach(void)
link = &lp->link; dev = &lp->dev; link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp; link->priv = dev->priv = link->irq.Instance = lp;
init_timer(&link->release);
link->release.function = &tc589_release; link->release.function = &tc589_release;
link->release.data = (unsigned long)link; link->release.data = (unsigned long)link;
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
......
...@@ -246,6 +246,7 @@ static dev_link_t *awc_attach(void) ...@@ -246,6 +246,7 @@ static dev_link_t *awc_attach(void)
memset(link->dev, 0, sizeof(struct dev_node_t)); memset(link->dev, 0, sizeof(struct dev_node_t));
init_timer(&link->release);
link->release.function = &awc_release; link->release.function = &awc_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
// link->io.NumPorts1 = 32; // link->io.NumPorts1 = 32;
......
...@@ -203,6 +203,7 @@ static dev_link_t *axnet_attach(void) ...@@ -203,6 +203,7 @@ static dev_link_t *axnet_attach(void)
link = &info->link; dev = &info->dev; link = &info->link; dev = &info->dev;
link->priv = info; link->priv = info;
init_timer(&link->release);
link->release.function = &axnet_release; link->release.function = &axnet_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
......
...@@ -221,6 +221,7 @@ static dev_link_t *com20020_attach(void) ...@@ -221,6 +221,7 @@ static dev_link_t *com20020_attach(void)
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
dev->priv = lp; dev->priv = lp;
init_timer(&link->release);
link->release.function = &com20020_release; link->release.function = &com20020_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
......
...@@ -221,6 +221,7 @@ static dev_link_t *ibmtr_attach(void) ...@@ -221,6 +221,7 @@ static dev_link_t *ibmtr_attach(void)
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info; link = &info->link; link->priv = info;
init_timer(&link->release);
link->release.function = &ibmtr_release; link->release.function = &ibmtr_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
......
...@@ -493,6 +493,7 @@ static dev_link_t *nmclan_attach(void) ...@@ -493,6 +493,7 @@ static dev_link_t *nmclan_attach(void)
link = &lp->link; dev = &lp->dev; link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp; link->priv = dev->priv = link->irq.Instance = lp;
init_timer(&link->release);
link->release.function = &nmclan_release; link->release.function = &nmclan_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->io.NumPorts1 = 32; link->io.NumPorts1 = 32;
......
...@@ -378,6 +378,7 @@ static dev_link_t *ray_attach(void) ...@@ -378,6 +378,7 @@ static dev_link_t *ray_attach(void)
memset(dev, 0, sizeof(struct net_device)); memset(dev, 0, sizeof(struct net_device));
memset(local, 0, sizeof(ray_dev_t)); memset(local, 0, sizeof(ray_dev_t));
init_timer(&link->release);
link->release.function = &ray_release; link->release.function = &ray_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
......
...@@ -632,6 +632,7 @@ xirc2ps_attach(void) ...@@ -632,6 +632,7 @@ xirc2ps_attach(void)
link = &local->link; dev = &local->dev; link = &local->link; dev = &local->dev;
link->priv = dev->priv = local; link->priv = dev->priv = local;
init_timer(&link->release);
link->release.function = &xirc2ps_release; link->release.function = &xirc2ps_release;
link->release.data = (u_long) link; link->release.data = (u_long) link;
......
...@@ -216,6 +216,7 @@ static dev_link_t *airo_attach(void) ...@@ -216,6 +216,7 @@ static dev_link_t *airo_attach(void)
return NULL; return NULL;
} }
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
init_timer(&link->release);
link->release.function = &airo_release; link->release.function = &airo_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
......
...@@ -462,6 +462,7 @@ static dev_link_t *netwave_attach(void) ...@@ -462,6 +462,7 @@ static dev_link_t *netwave_attach(void)
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
link = &priv->link; dev = &priv->dev; link = &priv->link; dev = &priv->dev;
link->priv = dev->priv = priv; link->priv = dev->priv = priv;
init_timer(&link->release);
link->release.function = &netwave_release; link->release.function = &netwave_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
......
...@@ -203,6 +203,7 @@ orinoco_cs_attach(void) ...@@ -203,6 +203,7 @@ orinoco_cs_attach(void)
link->priv = dev; link->priv = dev;
/* Initialize the dev_link_t structure */ /* Initialize the dev_link_t structure */
init_timer(&link->release);
link->release.function = &orinoco_cs_release; link->release.function = &orinoco_cs_release;
link->release.data = (u_long) link; link->release.data = (u_long) link;
......
...@@ -134,6 +134,7 @@ static dev_link_t *parport_attach(void) ...@@ -134,6 +134,7 @@ static dev_link_t *parport_attach(void)
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info; link = &info->link; link->priv = info;
init_timer(&link->release);
link->release.function = &parport_cs_release; link->release.function = &parport_cs_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
......
...@@ -142,6 +142,7 @@ static dev_link_t *aha152x_attach(void) ...@@ -142,6 +142,7 @@ static dev_link_t *aha152x_attach(void)
if (!info) return NULL; if (!info) return NULL;
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info; link = &info->link; link->priv = info;
init_timer(&link->release);
link->release.function = &aha152x_release_cs; link->release.function = &aha152x_release_cs;
link->release.data = (u_long)link; link->release.data = (u_long)link;
......
...@@ -122,6 +122,7 @@ static dev_link_t *fdomain_attach(void) ...@@ -122,6 +122,7 @@ static dev_link_t *fdomain_attach(void)
if (!info) return NULL; if (!info) return NULL;
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info; link = &info->link; link->priv = info;
init_timer(&link->release);
link->release.function = &fdomain_release; link->release.function = &fdomain_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
......
...@@ -126,6 +126,7 @@ static dev_link_t *qlogic_attach(void) ...@@ -126,6 +126,7 @@ static dev_link_t *qlogic_attach(void)
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; link = &info->link;
link->priv = info; link->priv = info;
init_timer(&link->release);
link->release.function = &qlogic_release; link->release.function = &qlogic_release;
link->release.data = (u_long) link; link->release.data = (u_long) link;
......
...@@ -63,6 +63,7 @@ static dev_link_t *ixj_attach(void) ...@@ -63,6 +63,7 @@ static dev_link_t *ixj_attach(void)
if (!link) if (!link)
return NULL; return NULL;
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
init_timer(&link->release);
link->release.function = &ixj_cs_release; link->release.function = &ixj_cs_release;
link->release.data = (u_long) link; link->release.data = (u_long) link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
......
...@@ -81,21 +81,11 @@ init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private) ...@@ -81,21 +81,11 @@ init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
* Return the address of the waitqueue_head to be used for this * Return the address of the waitqueue_head to be used for this
* buffer_head * buffer_head
*/ */
static wait_queue_head_t *bh_waitq_head(struct buffer_head *bh) wait_queue_head_t *bh_waitq_head(struct buffer_head *bh)
{ {
return &bh_wait_queue_heads[hash_ptr(bh, BH_WAIT_TABLE_ORDER)].wqh; return &bh_wait_queue_heads[hash_ptr(bh, BH_WAIT_TABLE_ORDER)].wqh;
} }
EXPORT_SYMBOL(bh_waitq_head);
/*
* Wait on a buffer until someone does a wakeup on it. Needs
* lots of external locking. ext3 uses this. Fix it.
*/
void sleep_on_buffer(struct buffer_head *bh)
{
wait_queue_head_t *wq = bh_waitq_head(bh);
sleep_on(wq);
}
EXPORT_SYMBOL(sleep_on_buffer);
void wake_up_buffer(struct buffer_head *bh) void wake_up_buffer(struct buffer_head *bh)
{ {
...@@ -139,7 +129,7 @@ void __wait_on_buffer(struct buffer_head * bh) ...@@ -139,7 +129,7 @@ void __wait_on_buffer(struct buffer_head * bh)
prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
blk_run_queues(); blk_run_queues();
if (buffer_locked(bh)) if (buffer_locked(bh))
schedule(); io_schedule();
} while (buffer_locked(bh)); } while (buffer_locked(bh));
put_bh(bh); put_bh(bh);
finish_wait(wqh, &wait); finish_wait(wqh, &wait);
......
...@@ -1147,21 +1147,24 @@ static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, ...@@ -1147,21 +1147,24 @@ static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt,
namelen = dentry->d_name.len; namelen = dentry->d_name.len;
buflen -= namelen + 1; buflen -= namelen + 1;
if (buflen < 0) if (buflen < 0)
break; return ERR_PTR(-ENAMETOOLONG);
end -= namelen; end -= namelen;
memcpy(end, dentry->d_name.name, namelen); memcpy(end, dentry->d_name.name, namelen);
*--end = '/'; *--end = '/';
retval = end; retval = end;
dentry = parent; dentry = parent;
} }
return retval; return retval;
global_root: global_root:
namelen = dentry->d_name.len; namelen = dentry->d_name.len;
buflen -= namelen; buflen -= namelen;
if (buflen >= 0) { if (buflen >= 0) {
retval -= namelen-1; /* hit the slash */ retval -= namelen-1; /* hit the slash */
memcpy(retval, dentry->d_name.name, namelen); memcpy(retval, dentry->d_name.name, namelen);
} } else
retval = ERR_PTR(-ENAMETOOLONG);
return retval; return retval;
} }
...@@ -1229,6 +1232,10 @@ asmlinkage long sys_getcwd(char *buf, unsigned long size) ...@@ -1229,6 +1232,10 @@ asmlinkage long sys_getcwd(char *buf, unsigned long size)
cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE); cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE);
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
error = PTR_ERR(cwd);
if (IS_ERR(cwd))
goto out;
error = -ERANGE; error = -ERANGE;
len = PAGE_SIZE + page - cwd; len = PAGE_SIZE + page - cwd;
if (len <= size) { if (len <= size) {
...@@ -1238,6 +1245,8 @@ asmlinkage long sys_getcwd(char *buf, unsigned long size) ...@@ -1238,6 +1245,8 @@ asmlinkage long sys_getcwd(char *buf, unsigned long size)
} }
} else } else
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
out:
dput(pwd); dput(pwd);
mntput(pwdmnt); mntput(pwdmnt);
dput(root); dput(root);
......
...@@ -892,15 +892,14 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, ...@@ -892,15 +892,14 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
ret = do_direct_IO(dio); ret = do_direct_IO(dio);
if (ret) {
dio_cleanup(dio);
break;
}
dio->result += iov[seg].iov_len - dio->result += iov[seg].iov_len -
((dio->final_block_in_request - dio->block_in_file) << ((dio->final_block_in_request - dio->block_in_file) <<
blkbits); blkbits);
if (ret) {
dio_cleanup(dio);
break;
}
} /* end iovec loop */ } /* end iovec loop */
/* /*
......
This diff is collapsed.
...@@ -873,12 +873,10 @@ int prepare_binprm(struct linux_binprm *bprm) ...@@ -873,12 +873,10 @@ int prepare_binprm(struct linux_binprm *bprm)
void compute_creds(struct linux_binprm *bprm) void compute_creds(struct linux_binprm *bprm)
{ {
int do_unlock = 0; task_lock(current);
if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) { if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) {
current->mm->dumpable = 0; current->mm->dumpable = 0;
lock_kernel();
if (must_not_trace_exec(current) if (must_not_trace_exec(current)
|| atomic_read(&current->fs->count) > 1 || atomic_read(&current->fs->count) > 1
|| atomic_read(&current->files->count) > 1 || atomic_read(&current->files->count) > 1
...@@ -888,14 +886,12 @@ void compute_creds(struct linux_binprm *bprm) ...@@ -888,14 +886,12 @@ void compute_creds(struct linux_binprm *bprm)
bprm->e_gid = current->gid; bprm->e_gid = current->gid;
} }
} }
do_unlock = 1;
} }
current->suid = current->euid = current->fsuid = bprm->e_uid; current->suid = current->euid = current->fsuid = bprm->e_uid;
current->sgid = current->egid = current->fsgid = bprm->e_gid; current->sgid = current->egid = current->fsgid = bprm->e_gid;
if(do_unlock) task_unlock(current);
unlock_kernel();
security_bprm_compute_creds(bprm); security_bprm_compute_creds(bprm);
} }
......
...@@ -334,22 +334,23 @@ int ext2_new_block (struct inode * inode, unsigned long goal, ...@@ -334,22 +334,23 @@ int ext2_new_block (struct inode * inode, unsigned long goal,
if (!prealloc_count || *prealloc_count) if (!prealloc_count || *prealloc_count)
prealloc_goal = 0; prealloc_goal = 0;
*err = -EDQUOT; if (DQUOT_ALLOC_BLOCK(inode, 1)) {
if (DQUOT_ALLOC_BLOCK(inode, 1)) *err = -EDQUOT;
goto out; goto out;
}
while (prealloc_goal && DQUOT_PREALLOC_BLOCK(inode, prealloc_goal)) while (prealloc_goal && DQUOT_PREALLOC_BLOCK(inode, prealloc_goal))
prealloc_goal--; prealloc_goal--;
dq_alloc = prealloc_goal + 1; dq_alloc = prealloc_goal + 1;
*err = -ENOSPC;
lock_super (sb); lock_super (sb);
es_alloc = reserve_blocks(sb, dq_alloc); es_alloc = reserve_blocks(sb, dq_alloc);
if (!es_alloc) if (!es_alloc) {
*err = -ENOSPC;
goto out_unlock; goto out_unlock;
}
ext2_debug ("goal=%lu.\n", goal); ext2_debug ("goal=%lu.\n", goal);
...@@ -396,8 +397,10 @@ int ext2_new_block (struct inode * inode, unsigned long goal, ...@@ -396,8 +397,10 @@ int ext2_new_block (struct inode * inode, unsigned long goal,
goto io_error; goto io_error;
group_alloc = group_reserve_blocks(desc, gdp_bh, es_alloc); group_alloc = group_reserve_blocks(desc, gdp_bh, es_alloc);
} }
if (bit >= sbi->s_groups_count) if (bit >= sbi->s_groups_count) {
*err = -ENOSPC;
goto out_release; goto out_release;
}
brelse(bitmap_bh); brelse(bitmap_bh);
bitmap_bh = read_block_bitmap(sb, group_no); bitmap_bh = read_block_bitmap(sb, group_no);
if (!bitmap_bh) if (!bitmap_bh)
...@@ -409,7 +412,7 @@ int ext2_new_block (struct inode * inode, unsigned long goal, ...@@ -409,7 +412,7 @@ int ext2_new_block (struct inode * inode, unsigned long goal,
"Free blocks count corrupted for block group %d", "Free blocks count corrupted for block group %d",
group_no); group_no);
group_alloc = 0; group_alloc = 0;
goto out_release; goto io_error;
} }
got_block: got_block:
...@@ -432,7 +435,7 @@ int ext2_new_block (struct inode * inode, unsigned long goal, ...@@ -432,7 +435,7 @@ int ext2_new_block (struct inode * inode, unsigned long goal,
"block(%d) >= blocks count(%d) - " "block(%d) >= blocks count(%d) - "
"block_group = %d, es == %p ", ret_block, "block_group = %d, es == %p ", ret_block,
le32_to_cpu(es->s_blocks_count), group_no, es); le32_to_cpu(es->s_blocks_count), group_no, es);
goto out_release; goto io_error;
} }
block = target_block; block = target_block;
...@@ -470,10 +473,10 @@ int ext2_new_block (struct inode * inode, unsigned long goal, ...@@ -470,10 +473,10 @@ int ext2_new_block (struct inode * inode, unsigned long goal,
ext2_debug ("allocating block %d. ", block); ext2_debug ("allocating block %d. ", block);
*err = 0;
out_release: out_release:
group_release_blocks(desc, gdp_bh, group_alloc); group_release_blocks(desc, gdp_bh, group_alloc);
release_blocks(sb, es_alloc); release_blocks(sb, es_alloc);
*err = 0;
out_unlock: out_unlock:
unlock_super (sb); unlock_super (sb);
DQUOT_FREE_BLOCK(inode, dq_alloc); DQUOT_FREE_BLOCK(inode, dq_alloc);
......
...@@ -1239,6 +1239,12 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr) ...@@ -1239,6 +1239,12 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
error = inode_change_ok(inode, iattr); error = inode_change_ok(inode, iattr);
if (error) if (error)
return error; return error;
if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
(iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
if (error)
return error;
}
inode_setattr(inode, iattr); inode_setattr(inode, iattr);
if (iattr->ia_valid & ATTR_MODE) if (iattr->ia_valid & ATTR_MODE)
error = ext2_acl_chmod(inode); error = ext2_acl_chmod(inode);
......
...@@ -67,6 +67,7 @@ void __mark_inode_dirty(struct inode *inode, int flags) ...@@ -67,6 +67,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
spin_lock(&inode_lock); spin_lock(&inode_lock);
if ((inode->i_state & flags) != flags) { if ((inode->i_state & flags) != flags) {
const int was_dirty = inode->i_state & I_DIRTY;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
inode->i_state |= flags; inode->i_state |= flags;
...@@ -90,7 +91,7 @@ void __mark_inode_dirty(struct inode *inode, int flags) ...@@ -90,7 +91,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
* If the inode was already on s_dirty or s_io, don't * If the inode was already on s_dirty or s_io, don't
* reposition it (that would break s_dirty time-ordering). * reposition it (that would break s_dirty time-ordering).
*/ */
if (!mapping->dirtied_when) { if (!was_dirty) {
mapping->dirtied_when = jiffies|1; /* 0 is special */ mapping->dirtied_when = jiffies|1; /* 0 is special */
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
} }
...@@ -280,7 +281,7 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) ...@@ -280,7 +281,7 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
__iget(inode); __iget(inode);
__writeback_single_inode(inode, really_sync, wbc); __writeback_single_inode(inode, really_sync, wbc);
if (wbc->sync_mode == WB_SYNC_HOLD) { if (wbc->sync_mode == WB_SYNC_HOLD) {
mapping->dirtied_when = jiffies; mapping->dirtied_when = jiffies|1;
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
} }
if (current_is_pdflush()) if (current_is_pdflush())
......
...@@ -176,6 +176,7 @@ void inode_init_once(struct inode *inode) ...@@ -176,6 +176,7 @@ void inode_init_once(struct inode *inode)
spin_lock_init(&inode->i_data.private_lock); spin_lock_init(&inode->i_data.private_lock);
INIT_LIST_HEAD(&inode->i_data.i_mmap); INIT_LIST_HEAD(&inode->i_data.i_mmap);
INIT_LIST_HEAD(&inode->i_data.i_mmap_shared); INIT_LIST_HEAD(&inode->i_data.i_mmap_shared);
spin_lock_init(&inode->i_lock);
} }
static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
......
...@@ -689,11 +689,14 @@ do_get_write_access(handle_t *handle, struct journal_head *jh, int force_copy) ...@@ -689,11 +689,14 @@ do_get_write_access(handle_t *handle, struct journal_head *jh, int force_copy)
* disk then we cannot do copy-out here. */ * disk then we cannot do copy-out here. */
if (jh->b_jlist == BJ_Shadow) { if (jh->b_jlist == BJ_Shadow) {
wait_queue_head_t *wqh;
JBUFFER_TRACE(jh, "on shadow: sleep"); JBUFFER_TRACE(jh, "on shadow: sleep");
spin_unlock(&journal_datalist_lock); spin_unlock(&journal_datalist_lock);
unlock_journal(journal); unlock_journal(journal);
/* commit wakes up all shadow buffers after IO */ /* commit wakes up all shadow buffers after IO */
sleep_on_buffer(jh2bh(jh)); wqh = bh_waitq_head(jh2bh(jh));
wait_event(*wqh, (jh->b_jlist != BJ_Shadow));
lock_journal(journal); lock_journal(journal);
goto repeat; goto repeat;
} }
......
...@@ -123,13 +123,13 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, cadd ...@@ -123,13 +123,13 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, cadd
case Q_GETFMT: { case Q_GETFMT: {
__u32 fmt; __u32 fmt;
down_read(&sb_dqopt(sb)->dqoff_sem); down_read(&sb_dqopt(sb)->dqptr_sem);
if (!sb_has_quota_enabled(sb, type)) { if (!sb_has_quota_enabled(sb, type)) {
up_read(&sb_dqopt(sb)->dqoff_sem); up_read(&sb_dqopt(sb)->dqptr_sem);
return -ESRCH; return -ESRCH;
} }
fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id; fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id;
up_read(&sb_dqopt(sb)->dqoff_sem); up_read(&sb_dqopt(sb)->dqptr_sem);
if (copy_to_user(addr, &fmt, sizeof(fmt))) if (copy_to_user(addr, &fmt, sizeof(fmt)))
return -EFAULT; return -EFAULT;
return 0; return 0;
......
...@@ -316,3 +316,45 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 * statbuf, long flag ...@@ -316,3 +316,45 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 * statbuf, long flag
} }
#endif /* LFS-64 */ #endif /* LFS-64 */
void inode_add_bytes(struct inode *inode, loff_t bytes)
{
spin_lock(&inode->i_lock);
inode->i_blocks += bytes >> 9;
bytes &= 511;
inode->i_bytes += bytes;
if (inode->i_bytes >= 512) {
inode->i_blocks++;
inode->i_bytes -= 512;
}
spin_unlock(&inode->i_lock);
}
void inode_sub_bytes(struct inode *inode, loff_t bytes)
{
spin_lock(&inode->i_lock);
inode->i_blocks -= bytes >> 9;
bytes &= 511;
if (inode->i_bytes < bytes) {
inode->i_blocks--;
inode->i_bytes += 512;
}
inode->i_bytes -= bytes;
spin_unlock(&inode->i_lock);
}
loff_t inode_get_bytes(struct inode *inode)
{
loff_t ret;
spin_lock(&inode->i_lock);
ret = (((loff_t)inode->i_blocks) << 9) + inode->i_bytes;
spin_unlock(&inode->i_lock);
return ret;
}
void inode_set_bytes(struct inode *inode, loff_t bytes)
{
inode->i_blocks = bytes >> 9;
inode->i_bytes = bytes & 511;
}
...@@ -71,7 +71,8 @@ static struct super_block *alloc_super(void) ...@@ -71,7 +71,8 @@ static struct super_block *alloc_super(void)
atomic_set(&s->s_active, 1); atomic_set(&s->s_active, 1);
sema_init(&s->s_vfs_rename_sem,1); sema_init(&s->s_vfs_rename_sem,1);
sema_init(&s->s_dquot.dqio_sem, 1); sema_init(&s->s_dquot.dqio_sem, 1);
init_rwsem(&s->s_dquot.dqoff_sem); sema_init(&s->s_dquot.dqonoff_sem, 1);
init_rwsem(&s->s_dquot.dqptr_sem);
s->s_maxbytes = MAX_NON_LFS; s->s_maxbytes = MAX_NON_LFS;
s->dq_op = sb_dquot_ops; s->dq_op = sb_dquot_ops;
s->s_qcop = sb_quotactl_ops; s->s_qcop = sb_quotactl_ops;
...@@ -310,7 +311,7 @@ void sync_filesystems(int wait) ...@@ -310,7 +311,7 @@ void sync_filesystems(int wait)
spin_lock(&sb_lock); spin_lock(&sb_lock);
for (sb = sb_entry(super_blocks.next); sb != sb_entry(&super_blocks); for (sb = sb_entry(super_blocks.next); sb != sb_entry(&super_blocks);
sb = sb_entry(sb->s_list.next)) { sb = sb_entry(sb->s_list.next)) {
if (!sb->s_op->sync_fs); if (!sb->s_op->sync_fs)
continue; continue;
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
continue; continue;
......
...@@ -13,18 +13,18 @@ ...@@ -13,18 +13,18 @@
} \ } \
\ \
/* Kernel symbol table: Normal symbols */ \ /* Kernel symbol table: Normal symbols */ \
__start___ksymtab = .; \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
__start___ksymtab = .; \
*(__ksymtab) \ *(__ksymtab) \
__stop___ksymtab = .; \
} \ } \
__stop___ksymtab = .; \
\ \
/* Kernel symbol table: GPL-only symbols */ \ /* Kernel symbol table: GPL-only symbols */ \
__start___gpl_ksymtab = .; \
__gpl_ksymtab : AT(ADDR(__gpl_ksymtab) - LOAD_OFFSET) { \ __gpl_ksymtab : AT(ADDR(__gpl_ksymtab) - LOAD_OFFSET) { \
__start___gpl_ksymtab = .; \
*(__gpl_ksymtab) \ *(__gpl_ksymtab) \
__stop___gpl_ksymtab = .; \
} \ } \
__stop___gpl_ksymtab = .; \
\ \
/* Kernel symbol table: strings */ \ /* Kernel symbol table: strings */ \
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
......
...@@ -89,8 +89,17 @@ static inline int pte_same(pte_t a, pte_t b) ...@@ -89,8 +89,17 @@ static inline int pte_same(pte_t a, pte_t b)
} }
#define pte_page(x) pfn_to_page(pte_pfn(x)) #define pte_page(x) pfn_to_page(pte_pfn(x))
#define pte_none(x) (!(x).pte_low && !(x).pte_high)
#define pte_pfn(x) (((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT))) static inline int pte_none(pte_t pte)
{
return !pte.pte_low && !pte.pte_high;
}
static inline unsigned long pte_pfn(pte_t pte)
{
return (pte.pte_low >> PAGE_SHIFT) |
(pte.pte_high << (32 - PAGE_SHIFT));
}
static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
{ {
......
...@@ -242,7 +242,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ...@@ -242,7 +242,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT)) ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT))
/* to find an entry in a page-table-directory. */ /* to find an entry in a page-table-directory. */
#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
#define __pgd_offset(address) pgd_index(address) #define __pgd_offset(address) pgd_index(address)
......
...@@ -287,8 +287,8 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; ...@@ -287,8 +287,8 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
* BLK_BOUNCE_ANY : don't bounce anything * BLK_BOUNCE_ANY : don't bounce anything
* BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary
*/ */
#define BLK_BOUNCE_HIGH (blk_max_low_pfn << PAGE_SHIFT) #define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
#define BLK_BOUNCE_ANY (blk_max_pfn << PAGE_SHIFT) #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
extern int init_emergency_isa_pool(void); extern int init_emergency_isa_pool(void);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/wait.h>
#include <asm/atomic.h> #include <asm/atomic.h>
enum bh_state_bits { enum bh_state_bits {
...@@ -154,7 +155,7 @@ void invalidate_bdev(struct block_device *, int); ...@@ -154,7 +155,7 @@ void invalidate_bdev(struct block_device *, int);
void __invalidate_buffers(kdev_t dev, int); void __invalidate_buffers(kdev_t dev, int);
int sync_blockdev(struct block_device *bdev); int sync_blockdev(struct block_device *bdev);
void __wait_on_buffer(struct buffer_head *); void __wait_on_buffer(struct buffer_head *);
void sleep_on_buffer(struct buffer_head *bh); wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
void wake_up_buffer(struct buffer_head *bh); void wake_up_buffer(struct buffer_head *bh);
int fsync_bdev(struct block_device *); int fsync_bdev(struct block_device *);
int fsync_super(struct super_block *); int fsync_super(struct super_block *);
......
...@@ -371,9 +371,10 @@ struct inode { ...@@ -371,9 +371,10 @@ struct inode {
struct timespec i_ctime; struct timespec i_ctime;
unsigned int i_blkbits; unsigned int i_blkbits;
unsigned long i_blksize; unsigned long i_blksize;
unsigned long i_blocks;
unsigned long i_version; unsigned long i_version;
unsigned long i_blocks;
unsigned short i_bytes; unsigned short i_bytes;
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
struct semaphore i_sem; struct semaphore i_sem;
struct inode_operations *i_op; struct inode_operations *i_op;
struct file_operations *i_fop; /* former ->i_op->default_file_ops */ struct file_operations *i_fop; /* former ->i_op->default_file_ops */
...@@ -400,7 +401,7 @@ struct inode { ...@@ -400,7 +401,7 @@ struct inode {
void *i_security; void *i_security;
__u32 i_generation; __u32 i_generation;
union { union {
void *generic_ip; void *generic_ip;
} u; } u;
}; };
...@@ -412,39 +413,6 @@ struct fown_struct { ...@@ -412,39 +413,6 @@ struct fown_struct {
void *security; void *security;
}; };
static inline void inode_add_bytes(struct inode *inode, loff_t bytes)
{
inode->i_blocks += bytes >> 9;
bytes &= 511;
inode->i_bytes += bytes;
if (inode->i_bytes >= 512) {
inode->i_blocks++;
inode->i_bytes -= 512;
}
}
static inline void inode_sub_bytes(struct inode *inode, loff_t bytes)
{
inode->i_blocks -= bytes >> 9;
bytes &= 511;
if (inode->i_bytes < bytes) {
inode->i_blocks--;
inode->i_bytes += 512;
}
inode->i_bytes -= bytes;
}
static inline loff_t inode_get_bytes(struct inode *inode)
{
return (((loff_t)inode->i_blocks) << 9) + inode->i_bytes;
}
static inline void inode_set_bytes(struct inode *inode, loff_t bytes)
{
inode->i_blocks = bytes >> 9;
inode->i_bytes = bytes & 511;
}
/* /*
* Track a single file's readahead state * Track a single file's readahead state
*/ */
...@@ -1277,6 +1245,10 @@ extern int page_symlink(struct inode *inode, const char *symname, int len); ...@@ -1277,6 +1245,10 @@ extern int page_symlink(struct inode *inode, const char *symname, int len);
extern struct inode_operations page_symlink_inode_operations; extern struct inode_operations page_symlink_inode_operations;
extern void generic_fillattr(struct inode *, struct kstat *); extern void generic_fillattr(struct inode *, struct kstat *);
extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
void inode_add_bytes(struct inode *inode, loff_t bytes);
void inode_sub_bytes(struct inode *inode, loff_t bytes);
loff_t inode_get_bytes(struct inode *inode);
void inode_set_bytes(struct inode *inode, loff_t bytes);
extern int vfs_readdir(struct file *, filldir_t, void *); extern int vfs_readdir(struct file *, filldir_t, void *);
......
...@@ -344,7 +344,7 @@ static inline int module_text_address(unsigned long addr) ...@@ -344,7 +344,7 @@ static inline int module_text_address(unsigned long addr)
} }
/* Get/put a kernel symbol (calls should be symmetric) */ /* Get/put a kernel symbol (calls should be symmetric) */
#define symbol_get(x) (&(x)) #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
#define symbol_put(x) do { } while(0) #define symbol_put(x) do { } while(0)
#define symbol_put_addr(x) do { } while(0) #define symbol_put_addr(x) do { } while(0)
......
...@@ -280,7 +280,8 @@ struct quota_format_type { ...@@ -280,7 +280,8 @@ struct quota_format_type {
struct quota_info { struct quota_info {
unsigned int flags; /* Flags for diskquotas on this device */ unsigned int flags; /* Flags for diskquotas on this device */
struct semaphore dqio_sem; /* lock device while I/O in progress */ struct semaphore dqio_sem; /* lock device while I/O in progress */
struct rw_semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device and ops using quota_info struct, pointers from inode to dquots */ struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */
struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
struct file *files[MAXQUOTAS]; /* fp's to quotafiles */ struct file *files[MAXQUOTAS]; /* fp's to quotafiles */
struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
......
...@@ -272,6 +272,10 @@ EXPORT_SYMBOL(vfs_fstat); ...@@ -272,6 +272,10 @@ EXPORT_SYMBOL(vfs_fstat);
EXPORT_SYMBOL(vfs_stat); EXPORT_SYMBOL(vfs_stat);
EXPORT_SYMBOL(vfs_lstat); EXPORT_SYMBOL(vfs_lstat);
EXPORT_SYMBOL(vfs_getattr); EXPORT_SYMBOL(vfs_getattr);
EXPORT_SYMBOL(inode_add_bytes);
EXPORT_SYMBOL(inode_sub_bytes);
EXPORT_SYMBOL(inode_get_bytes);
EXPORT_SYMBOL(inode_set_bytes);
EXPORT_SYMBOL(lock_rename); EXPORT_SYMBOL(lock_rename);
EXPORT_SYMBOL(unlock_rename); EXPORT_SYMBOL(unlock_rename);
EXPORT_SYMBOL(generic_read_dir); EXPORT_SYMBOL(generic_read_dir);
......
...@@ -27,6 +27,22 @@ ...@@ -27,6 +27,22 @@
#define DEBUGP(fmt, a...) #define DEBUGP(fmt, a...)
#endif #endif
static inline int dash2underscore(char c)
{
if (c == '-')
return '_';
return c;
}
static inline int parameq(const char *input, const char *paramname)
{
unsigned int i;
for (i = 0; dash2underscore(input[i]) == paramname[i]; i++)
if (input[i] == '\0')
return 1;
return 0;
}
static int parse_one(char *param, static int parse_one(char *param,
char *val, char *val,
struct kernel_param *params, struct kernel_param *params,
...@@ -37,7 +53,7 @@ static int parse_one(char *param, ...@@ -37,7 +53,7 @@ static int parse_one(char *param,
/* Find parameter */ /* Find parameter */
for (i = 0; i < num_params; i++) { for (i = 0; i < num_params; i++) {
if (strcmp(param, params[i].name) == 0) { if (parameq(param, params[i].name)) {
DEBUGP("They are equal! Calling %p\n", DEBUGP("They are equal! Calling %p\n",
params[i].set); params[i].set);
return params[i].set(val, &params[i]); return params[i].set(val, &params[i]);
...@@ -69,8 +85,6 @@ static char *next_arg(char *args, char **param, char **val) ...@@ -69,8 +85,6 @@ static char *next_arg(char *args, char **param, char **val)
if (equals == 0) { if (equals == 0) {
if (args[i] == '=') if (args[i] == '=')
equals = i; equals = i;
else if (args[i] == '-')
args[i] = '_';
} }
if (args[i] == '"') if (args[i] == '"')
in_quote = !in_quote; in_quote = !in_quote;
......
...@@ -2057,7 +2057,7 @@ static void show_task(task_t * p) ...@@ -2057,7 +2057,7 @@ static void show_task(task_t * p)
printk(" %016lx ", thread_saved_pc(p)); printk(" %016lx ", thread_saved_pc(p));
#endif #endif
{ {
unsigned long * n = (unsigned long *) (p+1); unsigned long * n = (unsigned long *) (p->thread_info+1);
while (!*n) while (!*n)
n++; n++;
free = (unsigned long) n - (unsigned long)(p+1); free = (unsigned long) n - (unsigned long)(p+1);
...@@ -2465,15 +2465,12 @@ void __preempt_spin_lock(spinlock_t *lock) ...@@ -2465,15 +2465,12 @@ void __preempt_spin_lock(spinlock_t *lock)
_raw_spin_lock(lock); _raw_spin_lock(lock);
return; return;
} }
do {
while (!_raw_spin_trylock(lock)) { preempt_enable();
if (need_resched()) { while (spin_is_locked(lock))
preempt_enable_no_resched(); cpu_relax();
__cond_resched(); preempt_disable();
preempt_disable(); } while (!_raw_spin_trylock(lock));
}
cpu_relax();
}
} }
void __preempt_write_lock(rwlock_t *lock) void __preempt_write_lock(rwlock_t *lock)
...@@ -2483,13 +2480,11 @@ void __preempt_write_lock(rwlock_t *lock) ...@@ -2483,13 +2480,11 @@ void __preempt_write_lock(rwlock_t *lock)
return; return;
} }
while (!_raw_write_trylock(lock)) { do {
if (need_resched()) { preempt_enable();
preempt_enable_no_resched(); while (rwlock_is_locked(lock))
__cond_resched(); cpu_relax();
preempt_disable(); preempt_disable();
} } while (!_raw_write_trylock(lock));
cpu_relax();
}
} }
#endif #endif
...@@ -1306,11 +1306,13 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -1306,11 +1306,13 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
return 0; return 0;
} }
/*
* This is for filesystems which do not implement ->writepage.
*/
int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma) int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)
{ {
if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE)) if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE))
return -EINVAL; return -EINVAL;
vma->vm_flags &= ~VM_MAYWRITE;
return generic_file_mmap(file, vma); return generic_file_mmap(file, vma);
} }
#else #else
......
...@@ -1265,8 +1265,9 @@ void exit_mmap(struct mm_struct *mm) ...@@ -1265,8 +1265,9 @@ void exit_mmap(struct mm_struct *mm)
tlb = tlb_gather_mmu(mm, 1); tlb = tlb_gather_mmu(mm, 1);
flush_cache_mm(mm); flush_cache_mm(mm);
/* Use ~0UL here to ensure all VMAs in the mm are unmapped */
mm->map_count -= unmap_vmas(&tlb, mm, mm->mmap, 0, mm->map_count -= unmap_vmas(&tlb, mm, mm->mmap, 0,
TASK_SIZE, &nr_accounted); ~0UL, &nr_accounted);
vm_unacct_memory(nr_accounted); vm_unacct_memory(nr_accounted);
BUG_ON(mm->map_count); /* This is just debugging */ BUG_ON(mm->map_count); /* This is just debugging */
clear_page_tables(tlb, FIRST_USER_PGD_NR, USER_PTRS_PER_PGD); clear_page_tables(tlb, FIRST_USER_PGD_NR, USER_PTRS_PER_PGD);
......
...@@ -769,7 +769,7 @@ static void poison_obj(kmem_cache_t *cachep, void *addr, unsigned char val) ...@@ -769,7 +769,7 @@ static void poison_obj(kmem_cache_t *cachep, void *addr, unsigned char val)
*(unsigned char *)(addr+size-1) = POISON_END; *(unsigned char *)(addr+size-1) = POISON_END;
} }
static int check_poison_obj (kmem_cache_t *cachep, void *addr) static void check_poison_obj(kmem_cache_t *cachep, void *addr)
{ {
int size = cachep->objsize; int size = cachep->objsize;
void *end; void *end;
...@@ -779,8 +779,7 @@ static int check_poison_obj (kmem_cache_t *cachep, void *addr) ...@@ -779,8 +779,7 @@ static int check_poison_obj (kmem_cache_t *cachep, void *addr)
} }
end = memchr(addr, POISON_END, size); end = memchr(addr, POISON_END, size);
if (end != (addr+size-1)) if (end != (addr+size-1))
return 1; slab_error(cachep, "object was modified after freeing");
return 0;
} }
#endif #endif
...@@ -1420,6 +1419,8 @@ static int cache_grow (kmem_cache_t * cachep, int flags) ...@@ -1420,6 +1419,8 @@ static int cache_grow (kmem_cache_t * cachep, int flags)
opps1: opps1:
kmem_freepages(cachep, objp); kmem_freepages(cachep, objp);
failed: failed:
if (local_flags & __GFP_WAIT)
local_irq_disable();
return 0; return 0;
} }
...@@ -1628,8 +1629,7 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep, ...@@ -1628,8 +1629,7 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep,
if (!objp) if (!objp)
return objp; return objp;
if (cachep->flags & SLAB_POISON) if (cachep->flags & SLAB_POISON)
if (check_poison_obj(cachep, objp)) check_poison_obj(cachep, objp);
BUG();
if (cachep->flags & SLAB_RED_ZONE) { if (cachep->flags & SLAB_RED_ZONE) {
/* Set alloc red-zone, and check old one. */ /* Set alloc red-zone, and check old one. */
if (xchg((unsigned long *)objp, RED_ACTIVE) != RED_INACTIVE) if (xchg((unsigned long *)objp, RED_ACTIVE) != RED_INACTIVE)
......
...@@ -120,17 +120,16 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm) ...@@ -120,17 +120,16 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm)
{ {
/* Derived from fs/exec.c:compute_creds. */ /* Derived from fs/exec.c:compute_creds. */
kernel_cap_t new_permitted, working; kernel_cap_t new_permitted, working;
int do_unlock = 0;
new_permitted = cap_intersect (bprm->cap_permitted, cap_bset); new_permitted = cap_intersect (bprm->cap_permitted, cap_bset);
working = cap_intersect (bprm->cap_inheritable, working = cap_intersect (bprm->cap_inheritable,
current->cap_inheritable); current->cap_inheritable);
new_permitted = cap_combine (new_permitted, working); new_permitted = cap_combine (new_permitted, working);
task_lock(current);
if (!cap_issubset (new_permitted, current->cap_permitted)) { if (!cap_issubset (new_permitted, current->cap_permitted)) {
current->mm->dumpable = 0; current->mm->dumpable = 0;
lock_kernel ();
if (must_not_trace_exec (current) if (must_not_trace_exec (current)
|| atomic_read (&current->fs->count) > 1 || atomic_read (&current->fs->count) > 1
|| atomic_read (&current->files->count) > 1 || atomic_read (&current->files->count) > 1
...@@ -141,7 +140,6 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm) ...@@ -141,7 +140,6 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm)
cap_permitted); cap_permitted);
} }
} }
do_unlock = 1;
} }
/* For init, we want to retain the capabilities set /* For init, we want to retain the capabilities set
...@@ -154,9 +152,7 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm) ...@@ -154,9 +152,7 @@ void cap_bprm_compute_creds (struct linux_binprm *bprm)
} }
/* AUD: Audit candidate if current->cap_effective is set */ /* AUD: Audit candidate if current->cap_effective is set */
task_unlock(current);
if (do_unlock)
unlock_kernel ();
current->keep_capabilities = 0; current->keep_capabilities = 0;
} }
......
...@@ -668,7 +668,7 @@ static int ac97_read_mixer(struct ess_card *card, int mixer) ...@@ -668,7 +668,7 @@ static int ac97_read_mixer(struct ess_card *card, int mixer)
if (mixer == SOUND_MIXER_IGAIN) { if (mixer == SOUND_MIXER_IGAIN) {
right = (right * 100) / mh->scale; right = (right * 100) / mh->scale;
left = (left * 100) / mh->scale; left = (left * 100) / mh->scale;
else { } else {
right = 100 - ((right * 100) / mh->scale); right = 100 - ((right * 100) / mh->scale);
left = 100 - ((left * 100) / mh->scale); left = 100 - ((left * 100) / mh->scale);
} }
......
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#define __KERNEL_SYSCALLS__
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/unistd.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
static int do_mod_firmware_load(const char *fn, char **fp) static int do_mod_firmware_load(const char *fn, char **fp)
......
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