Commit 7e47b7af authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
parents fae319a5 69202577
......@@ -115,7 +115,7 @@ long sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r5,
* Set up the sigcontext for the signal frame.
*/
static int setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
static long setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
int signr, sigset_t *set, unsigned long handler)
{
/* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
......@@ -129,7 +129,7 @@ static int setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
#ifdef CONFIG_ALTIVEC
elf_vrreg_t *v_regs = (elf_vrreg_t *)(((unsigned long)sc->vmx_reserve) & ~0xful);
#endif
int err = 0;
long err = 0;
if (regs->msr & MSR_FP)
giveup_fpu(current);
......@@ -173,18 +173,32 @@ static int setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
* Restore the sigcontext from the signal frame.
*/
static int restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, struct sigcontext *sc)
static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
struct sigcontext *sc)
{
#ifdef CONFIG_ALTIVEC
elf_vrreg_t *v_regs;
#endif
unsigned int err = 0;
unsigned long err = 0;
unsigned long save_r13;
elf_greg_t *gregs = (elf_greg_t *)regs;
int i;
/* If this is not a signal return, we preserve the TLS in r13 */
if (!sig)
save_r13 = regs->gpr[13];
err |= __copy_from_user(regs, &sc->gp_regs, GP_REGS_SIZE);
/* copy everything before MSR */
err |= __copy_from_user(regs, &sc->gp_regs,
PT_MSR*sizeof(unsigned long));
/* skip MSR and SOFTE */
for (i = PT_MSR+1; i <= PT_RESULT; i++) {
if (i == PT_SOFTE)
continue;
err |= __get_user(gregs[i], &sc->gp_regs[i]);
}
if (!sig)
regs->gpr[13] = save_r13;
err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
......@@ -235,9 +249,10 @@ static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
/*
* Setup the trampoline code on the stack
*/
static int setup_trampoline(unsigned int syscall, unsigned int *tramp)
static long setup_trampoline(unsigned int syscall, unsigned int *tramp)
{
int i, err = 0;
int i;
long err = 0;
/* addi r1, r1, __SIGNAL_FRAMESIZE # Pop the dummy stackframe */
err |= __put_user(0x38210000UL | (__SIGNAL_FRAMESIZE & 0xffff), &tramp[0]);
......@@ -372,7 +387,7 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
func_descr_t *funct_desc_ptr;
struct rt_sigframe *frame;
unsigned long newsp = 0;
int err = 0;
long err = 0;
frame = get_sigframe(ka, regs, sizeof(*frame));
......
......@@ -185,25 +185,28 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 *frame, int si
* Restore the current user register values from the user stack,
* (except for MSR).
*/
static int restore_user_regs(struct pt_regs *regs, struct mcontext32 __user *sr, int sig)
static long restore_user_regs(struct pt_regs *regs,
struct mcontext32 __user *sr, int sig)
{
elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
int i, err = 0;
int i;
long err = 0;
unsigned int save_r2;
#ifdef CONFIG_ALTIVEC
unsigned long msr;
#endif
/*
* restore general registers but not including MSR. Also take
* care of keeping r2 (TLS) intact if not a signal
* restore general registers but not including MSR or SOFTE. Also
* take care of keeping r2 (TLS) intact if not a signal
*/
if (!sig)
save_r2 = (unsigned int)regs->gpr[2];
for (i = 0; i < PT_MSR; i ++)
err |= __get_user(gregs[i], &sr->mc_gregs[i]);
for (i ++; i <= PT_RESULT; i ++)
for (i = 0; i <= PT_RESULT; i++) {
if ((i == PT_MSR) || (i == PT_SOFTE))
continue;
err |= __get_user(gregs[i], &sr->mc_gregs[i]);
}
if (!sig)
regs->gpr[2] = (unsigned long) save_r2;
if (err)
......@@ -427,9 +430,9 @@ long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
}
static int copy_siginfo_to_user32(compat_siginfo_t *d, siginfo_t *s)
static long copy_siginfo_to_user32(compat_siginfo_t *d, siginfo_t *s)
{
int err;
long err;
if (!access_ok (VERIFY_WRITE, d, sizeof(*d)))
return -EFAULT;
......
......@@ -15,6 +15,7 @@
#include <linux/pagemap.h>
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <asm/page.h>
#include "rock.h"
......@@ -358,7 +359,7 @@ int parse_rock_ridge_inode_internal(struct iso_directory_record * de,
return 0;
}
static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr)
static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr, char *plimit)
{
int slen;
int rootflag;
......@@ -370,16 +371,25 @@ static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr)
rootflag = 0;
switch (slp->flags & ~1) {
case 0:
if (slp->len > plimit - rpnt)
return NULL;
memcpy(rpnt, slp->text, slp->len);
rpnt+=slp->len;
break;
case 2:
if (rpnt >= plimit)
return NULL;
*rpnt++='.';
break;
case 4:
if (2 > plimit - rpnt)
return NULL;
*rpnt++='.';
/* fallthru */
case 2:
*rpnt++='.';
break;
case 8:
if (rpnt >= plimit)
return NULL;
rootflag = 1;
*rpnt++='/';
break;
......@@ -396,17 +406,23 @@ static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr)
* If there is another SL record, and this component
* record isn't continued, then add a slash.
*/
if ((!rootflag) && (rr->u.SL.flags & 1) && !(oldslp->flags & 1))
if ((!rootflag) && (rr->u.SL.flags & 1) &&
!(oldslp->flags & 1)) {
if (rpnt >= plimit)
return NULL;
*rpnt++='/';
}
break;
}
/*
* If this component record isn't continued, then append a '/'.
*/
if (!rootflag && !(oldslp->flags & 1))
if (!rootflag && !(oldslp->flags & 1)) {
if (rpnt >= plimit)
return NULL;
*rpnt++='/';
}
}
return rpnt;
}
......@@ -487,7 +503,10 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
CHECK_SP(goto out);
break;
case SIG('S', 'L'):
rpnt = get_symlink_chunk(rpnt, rr);
rpnt = get_symlink_chunk(rpnt, rr,
link + (PAGE_SIZE - 1));
if (rpnt == NULL)
goto out;
break;
case SIG('C', 'E'):
/* This tells is if there is a continuation record */
......
......@@ -2977,11 +2977,12 @@ int jfs_sync(void *arg)
anon_inode_list);
ip = &jfs_ip->vfs_inode;
/*
* down_trylock returns 0 on success. This is
* inconsistent with spin_trylock.
*/
if (! down_trylock(&jfs_ip->commit_sem)) {
if (! igrab(ip)) {
/*
* Inode is being freed
*/
list_del_init(&jfs_ip->anon_inode_list);
} else if (! down_trylock(&jfs_ip->commit_sem)) {
/*
* inode will be removed from anonymous list
* when it is committed
......@@ -2991,6 +2992,8 @@ int jfs_sync(void *arg)
rc = txCommit(tid, 1, &ip, 0);
txEnd(tid);
up(&jfs_ip->commit_sem);
iput(ip);
/*
* Just to be safe. I don't know how
* long we can run without blocking
......@@ -3010,6 +3013,10 @@ int jfs_sync(void *arg)
/* Put on anon_list2 */
list_add(&jfs_ip->anon_inode_list,
&TxAnchor.anon_list2);
TXN_UNLOCK();
iput(ip);
TXN_LOCK();
}
}
/* Add anon_list2 back to anon_list */
......
......@@ -182,7 +182,7 @@ static void rcu_offline_cpu(int cpu)
* it here
*/
spin_lock_irq(&rcu_ctrlblk.mutex);
if (!rcu_ctrlblk.rcu_cpu_mask)
if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask))
goto unlock;
cpu_clear(cpu, rcu_ctrlblk.rcu_cpu_mask);
......
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