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