From 7278a84642b9aa6877c260976d12664b51ad16ec Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 22 Feb 2007 15:50:50 +0000 Subject: [PATCH] 1:1 Userland threading stage 4.2/4: Make signal system fully lwp-aware by splitting ksignal() in appropriate functions. Introduce lwpsignal(), which now contains the logic of ksignal(), but can be used to deliver a signal to a specific lwp. Convert consumers of ksignal() to use lwpsignal() when they actually generate a thread-specific signal. Fully implement proc_stop() and proc_unstop(). Reviewed-by: Thomas E. Spanjaard --- sys/emulation/linux/i386/linux_sysvec.c | 6 +- sys/kern/kern_sig.c | 171 +++++++++++++++++++----- sys/kern/kern_synch.c | 22 ++- sys/kern/sys_generic.c | 5 +- sys/kern/uipc_syscalls.c | 5 +- sys/platform/pc32/isa/npx.c | 4 +- sys/platform/vkernel/i386/npx.c | 6 +- sys/sys/signalvar.h | 3 +- sys/vfs/gnu/ext2fs/ext2_readwrite.c | 4 +- sys/vfs/msdosfs/msdosfs_vnops.c | 5 +- sys/vfs/nfs/nfs_bio.c | 4 +- sys/vfs/nwfs/nwfs_io.c | 4 +- sys/vfs/procfs/procfs_ctl.c | 4 +- sys/vfs/smbfs/smbfs_io.c | 4 +- sys/vfs/ufs/ufs_readwrite.c | 4 +- 15 files changed, 190 insertions(+), 61 deletions(-) diff --git a/sys/emulation/linux/i386/linux_sysvec.c b/sys/emulation/linux/i386/linux_sysvec.c index 7f114af625..57178ed241 100644 --- a/sys/emulation/linux/i386/linux_sysvec.c +++ b/sys/emulation/linux/i386/linux_sysvec.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.55.2.9 2002/01/12 11:03:30 bde Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux_sysvec.c,v 1.28 2007/02/06 05:56:03 y0netan1 Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux_sysvec.c,v 1.29 2007/02/22 15:50:49 corecode Exp $ */ /* XXX we use functions that might not exist. */ @@ -293,7 +293,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) kprintf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"), fp, oonstack); #endif - ksignal(p, SIGILL); + lwpsignal(p, lp, SIGILL); return; } @@ -445,7 +445,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) SIGDELSET(p->p_sigignore, SIGILL); SIGDELSET(p->p_sigcatch, SIGILL); SIGDELSET(lp->lwp_sigmask, SIGILL); - ksignal(p, SIGILL); + lwpsignal(p, lp, SIGILL); return; } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 2bc4fd7678..7541bb8627 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -37,7 +37,7 @@ * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 * $FreeBSD: src/sys/kern/kern_sig.c,v 1.72.2.17 2003/05/16 16:34:34 obrien Exp $ - * $DragonFly: src/sys/kern/kern_sig.c,v 1.70 2007/02/22 15:48:55 corecode Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.71 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_ktrace.h" @@ -78,6 +78,7 @@ static char *expand_name(const char *, uid_t, pid_t); static int dokillpg(int sig, int pgid, int all); static int sig_ffs(sigset_t *set); static int sigprop(int sig); +static void lwp_signotify(struct lwp *lp); #ifdef SMP static void signotify_remote(void *arg); #endif @@ -814,7 +815,7 @@ trapsignal(struct lwp *lp, int sig, u_long code) } else { lp->lwp_code = code; /* XXX for core dump/debugger */ lp->lwp_sig = sig; /* XXX to verify code */ - ksignal(p, sig); + lwpsignal(p, lp, sig); } } @@ -889,15 +890,26 @@ find_lwp_for_signal(struct proc *p, int sig) void ksignal(struct proc *p, int sig) { - struct lwp *lp; + lwpsignal(p, NULL, sig); +} + +/* + * The core for ksignal. lp may be NULL, then a suitable thread + * will be chosen. If not, lp MUST be a member of p. + */ +void +lwpsignal(struct proc *p, struct lwp *lp, int sig) +{ int prop; sig_t action; if (sig > _SIG_MAXSIG || sig <= 0) { - kprintf("ksignal: signal %d\n", sig); - panic("ksignal signal number"); + kprintf("lwpsignal: signal %d\n", sig); + panic("lwpsignal signal number"); } + KKASSERT(lp == NULL || lp->lwp_proc == p); + crit_enter(); KNOTE(&p->p_klist, NOTE_SIGNAL | sig); crit_exit(); @@ -969,7 +981,7 @@ ksignal(struct proc *p, int sig) */ if (sig == SIGKILL) { proc_unstop(p); - goto out; + goto active_process; } /* @@ -1005,17 +1017,24 @@ ksignal(struct proc *p, int sig) * we don't want to wait until it reaches userret! */ if (prop & SA_STOP) { - lp = lwkt_preempted_proc(); - if (lp == NULL || lp->lwp_proc != p) + if (lwkt_preempted_proc() == NULL || + lwkt_preempted_proc()->lwp_proc != p) SIGDELSET(p->p_siglist, sig); } /* * Otherwise the process is stopped and it received some * signal, which does not change its stopped state. - * Just exit, as soon as the process continues, it will - * process the signal. + * + * We have to select one thread to set LWP_BREAKTSLEEP, + * so that the current signal will break the sleep + * as soon as a SA_CONT signal will unstop the process. */ + if (lp == NULL) + lp = find_lwp_for_signal(p, sig); + if (lp != NULL && + (lp->lwp_stat == LSSLEEP || lp->lwp_stat == LSSTOP)) + lp->lwp_flag |= LWP_BREAKTSLEEP; goto out; /* NOTREACHED */ @@ -1023,14 +1042,19 @@ ksignal(struct proc *p, int sig) /* else not stopped */ active_process: - lp = find_lwp_for_signal(p, sig); + if (lp == NULL) + lp = find_lwp_for_signal(p, sig); /* * If lp == NULL, there is no thread available which does - * not block the signal. Defer further processing for this signal. + * not block the signal. If lp is set, it might be a thread + * specific signal, so we have to check for the thread ignoring + * the signal. + * + * If so, defer further processing for this signal. * Add the signal to the process pending list. */ - if (lp == NULL) { + if (lp == NULL || SIGISMEMBER(lp->lwp_sigmask, sig)) { SIGADDSET(p->p_siglist, sig); goto out; } @@ -1077,7 +1101,17 @@ active_process: */ SIGADDSET(lp->lwp_siglist, sig); - if (lp->lwp_stat == LSSLEEP) { + lwp_signotify(lp); + +out: + crit_exit(); +} + +static void +lwp_signotify(struct lwp *lp) +{ + crit_enter(); + if (lp->lwp_stat == LSSLEEP || lp->lwp_stat == LSSTOP) { /* * Thread is in tsleep. */ @@ -1087,21 +1121,19 @@ active_process: * we can't interrupt the sleep... the signal will * be noticed when the lwp returns through * trap() or syscall(). - */ - if ((lp->lwp_flag & LWP_SINTR) == 0) - goto out; - - /* + * * Otherwise the signal can interrupt the sleep. * * If the process is traced, the lwp will handle the * tracing in issignal() when it returns to userland. */ - /* - * Make runnable and break out of any tsleep as well. - */ - lp->lwp_flag |= LWP_BREAKTSLEEP; - setrunnable(lp); + if (lp->lwp_flag & LWP_SINTR) { + /* + * Make runnable and break out of any tsleep as well. + */ + lp->lwp_flag |= LWP_BREAKTSLEEP; + setrunnable(lp); + } } else { /* * Otherwise the thread is running @@ -1126,6 +1158,7 @@ active_process: signotify(); } else if (lp->lwp_stat == LSRUN) { struct thread *td = lp->lwp_thread; + struct proc *p = lp->lwp_proc; KASSERT(td != NULL, ("pid %d/%d NULL lwp_thread stat %d flags %08x/%08x", @@ -1141,7 +1174,6 @@ active_process: lwkt_schedule(td); } } -out: crit_exit(); } @@ -1171,8 +1203,52 @@ signotify_remote(void *arg) void proc_stop(struct proc *p, int notify) { - /* XXX lwp */ + struct lwp *lp, *preempted; + int stopped; + + /* If somebody raced us, be happy with it */ + if (p->p_stat == SSTOP) + return; + p->p_stat = SSTOP; + + preempted = lwkt_preempted_proc(); + stopped = 0; + FOREACH_LWP_IN_PROC(lp, p) { + switch (lp->lwp_stat) { + case LSSTOP: + /* + * Do nothing, we are already counted in + * p_nstopped. + */ + break; + + case LSSLEEP: + /* + * We're sleeping, but we will stop before + * returning to userspace, so count us + * as stopped as well. Don't increment + * p_nstopped, that will happen in tstop(). + */ + ++stopped; + break; + + case LSRUN: + lwp_signotify(lp); + /* + * No need to wait for the preempted/current + * lwp. It will stop on return to userland + * later, so consider it as stopped. + */ + if (lp == preempted) + ++stopped; + break; + } + } + + while (p->p_nstopped + stopped < p->p_nthreads) + tsleep(&p->p_nstopped, 0, "pstop", hz); + p->p_flag &= ~P_WAITED; wakeup(p->p_pptr); if (notify > 1 || @@ -1183,10 +1259,34 @@ proc_stop(struct proc *p, int notify) void proc_unstop(struct proc *p) { - struct lwp *lp = FIRST_LWP_IN_PROC(p); /* XXX lwp */ + struct lwp *lp; + if (p->p_stat != SSTOP) + return; p->p_stat = SACTIVE; - setrunnable(lp); + + FOREACH_LWP_IN_PROC(lp, p) { + switch (lp->lwp_stat) { + case LSRUN: + /* + * Uh? Not stopped? Well, I guess that's okay. + */ + if (bootverbose) + kprintf("proc_unstop: lwp %d/%d not sleeping\n", + p->p_pid, lp->lwp_tid); + break; + + case LSSTOP: + setrunnable(lp); + break; + + case LSSLEEP: + /* + * Still sleeping. Don't bother waking it up. + */ + break; + } + } } static int @@ -1316,6 +1416,12 @@ sys_sigtimedwait(struct sigtimedwait_args *uap) if (uap->info) error = copyout(&info, uap->info, sizeof(info)); /* Repost if we got an error. */ + /* + * XXX lwp + * + * This could transform a thread-specific signal to another + * thread / process pending signal. + */ if (error) ksignal(curproc, info.si_signo); else @@ -1339,6 +1445,12 @@ sys_sigwaitinfo(struct sigwaitinfo_args *uap) if (uap->info) error = copyout(&info, uap->info, sizeof(info)); /* Repost if we got an error. */ + /* + * XXX lwp + * + * This could transform a thread-specific signal to another + * thread / process pending signal. + */ if (error) ksignal(curproc, info.si_signo); else @@ -1446,7 +1558,6 @@ issignal(struct lwp *lp) * * XXX lwp might need a call to ksignal() */ - /* XXX should run via ksignal? */ SIGADDSET(p->p_siglist, sig); if (SIGISMEMBER(lp->lwp_sigmask, sig)) continue; @@ -1889,7 +2000,7 @@ out2: int sys_nosys(struct nosys_args *args) { - ksignal(curproc, SIGSYS); + lwpsignal(curproc, curthread->td_lwp, SIGSYS); return (EINVAL); } diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 678cf58a5c..16adec9641 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -37,7 +37,7 @@ * * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95 * $FreeBSD: src/sys/kern/kern_synch.c,v 1.87.2.6 2002/10/13 07:29:53 kbyanc Exp $ - * $DragonFly: src/sys/kern/kern_synch.c,v 1.78 2007/02/22 15:49:08 corecode Exp $ + * $DragonFly: src/sys/kern/kern_synch.c,v 1.79 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_ktrace.h" @@ -382,8 +382,11 @@ tsleep(void *ident, int flags, const char *wmesg, int timo) crit_enter_quick(td); KASSERT(ident != NULL, ("tsleep: no ident")); - KASSERT(lp == NULL || lp->lwp_stat == LSRUN, ("tsleep %p %s %d", - ident, wmesg, lp->lwp_stat)); + KASSERT(lp == NULL || + lp->lwp_stat == LSRUN || /* Obvious */ + lp->lwp_stat == LSSTOP, /* Set in tstop */ + ("tsleep %p %s %d", + ident, wmesg, lp->lwp_stat)); /* * Setup for the current process (if this is a process). @@ -456,7 +459,11 @@ tsleep(void *ident, int flags, const char *wmesg, int timo) * Ok, we are sleeping. Place us in the SSLEEP state. */ KKASSERT((lp->lwp_flag & LWP_ONRUNQ) == 0); - lp->lwp_stat = LSSLEEP; + /* + * tstop() sets LSSTOP, so don't fiddle with that. + */ + if (lp->lwp_stat != LSSTOP) + lp->lwp_stat = LSSLEEP; lp->lwp_ru.ru_nvcsw++; lwkt_switch(); @@ -936,9 +943,16 @@ void tstop(void) { struct lwp *lp = curthread->td_lwp; + struct proc *p = lp->lwp_proc; lp->lwp_flag |= LWP_BREAKTSLEEP; + lp->lwp_stat = LSSTOP; + crit_enter(); + p->p_nstopped++; + wakeup(&p->p_nstopped); /* For the waiter in proc_stop() */ tsleep(lp->lwp_proc, 0, "stop", 0); + p->p_nstopped--; + crit_exit(); } /* diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 50c77b05bb..efe286dcbf 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -37,7 +37,7 @@ * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/sys_generic.c,v 1.55.2.10 2001/03/17 10:39:32 peter Exp $ - * $DragonFly: src/sys/kern/sys_generic.c,v 1.43 2007/02/18 16:13:27 corecode Exp $ + * $DragonFly: src/sys/kern/sys_generic.c,v 1.44 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_ktrace.h" @@ -463,6 +463,7 @@ static int dofilewrite(int fd, struct file *fp, struct uio *auio, int flags, int *res) { struct thread *td = curthread; + struct lwp *lp = td->td_lwp; struct proc *p = td->td_proc; int error; int len; @@ -494,7 +495,7 @@ dofilewrite(int fd, struct file *fp, struct uio *auio, int flags, int *res) /* Socket layer is responsible for issuing SIGPIPE. */ if (error == EPIPE) { get_mplock(); - ksignal(p, SIGPIPE); + lwpsignal(p, lp, SIGPIPE); rel_mplock(); } } diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 4f3eee0338..2be754cbe5 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -35,7 +35,7 @@ * * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 * $FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.65.2.17 2003/04/04 17:11:16 tegge Exp $ - * $DragonFly: src/sys/kern/uipc_syscalls.c,v 1.78 2007/01/28 06:31:00 y0netan1 Exp $ + * $DragonFly: src/sys/kern/uipc_syscalls.c,v 1.79 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_ktrace.h" @@ -619,6 +619,7 @@ kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio, struct mbuf *control, int flags, int *res) { struct thread *td = curthread; + struct lwp *lp = td->td_lwp; struct proc *p = td->td_proc; struct file *fp; int len, error; @@ -656,7 +657,7 @@ kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio, error == EINTR || error == EWOULDBLOCK)) error = 0; if (error == EPIPE) - ksignal(p, SIGPIPE); + lwpsignal(p, lp, SIGPIPE); } #ifdef KTRACE if (ktriov != NULL) { diff --git a/sys/platform/pc32/isa/npx.c b/sys/platform/pc32/isa/npx.c index b05fe46a21..d58d986694 100644 --- a/sys/platform/pc32/isa/npx.c +++ b/sys/platform/pc32/isa/npx.c @@ -33,7 +33,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.41 2007/02/03 17:05:58 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.42 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_cpu.h" @@ -835,7 +835,7 @@ npx_intr(void *dummy) * * Treat them like a true async interrupt. */ - ksignal(curproc, SIGFPE); + lwpsignal(curproc, curthread->td_lwp, SIGFPE); } rel_mplock(); crit_exit(); diff --git a/sys/platform/vkernel/i386/npx.c b/sys/platform/vkernel/i386/npx.c index 980ef8bd17..ba064234cf 100644 --- a/sys/platform/vkernel/i386/npx.c +++ b/sys/platform/vkernel/i386/npx.c @@ -36,7 +36,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/npx.c,v 1.5 2007/02/03 17:05:58 corecode Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/npx.c,v 1.6 2007/02/22 15:50:49 corecode Exp $ */ #include "opt_debug_npx.h" @@ -420,7 +420,7 @@ npx_intr(void *dummy) */ code = fpetable[(*exstat & ~control & 0x3f) | (*exstat & 0x40)]; - trapsignal(curproc, SIGFPE, code); + trapsignal(curthread->td_lwp, SIGFPE, code); } else { /* * Nested interrupt. These losers occur when: @@ -436,7 +436,7 @@ npx_intr(void *dummy) * * Treat them like a true async interrupt. */ - ksignal(curproc, SIGFPE); + lwpsignal(curproc, curthread->td_lwp, SIGFPE); } rel_mplock(); crit_exit(); diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 58bd9adcfe..a1a3a1bf91 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -32,7 +32,7 @@ * * @(#)signalvar.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/signalvar.h,v 1.34.2.1 2000/05/16 06:58:05 dillon Exp $ - * $DragonFly: src/sys/sys/signalvar.h,v 1.19 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/sys/signalvar.h,v 1.20 2007/02/22 15:50:49 corecode Exp $ */ #ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */ @@ -196,6 +196,7 @@ void pgsigio (struct sigio *, int signum, int checkctty); void pgsignal (struct pgrp *pgrp, int sig, int checkctty); void postsig (int sig); void ksignal (struct proc *p, int sig); +void lwpsignal (struct proc *p, struct lwp *lp, int sig); void siginit (struct proc *p); void trapsignal (struct lwp *p, int sig, u_long code); static int __cursig (struct lwp *p); diff --git a/sys/vfs/gnu/ext2fs/ext2_readwrite.c b/sys/vfs/gnu/ext2fs/ext2_readwrite.c index 9e76207096..f424c8e0ec 100644 --- a/sys/vfs/gnu/ext2fs/ext2_readwrite.c +++ b/sys/vfs/gnu/ext2fs/ext2_readwrite.c @@ -38,7 +38,7 @@ * * @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_readwrite.c,v 1.18.2.2 2000/12/22 18:44:33 dillon Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.12 2006/09/03 18:29:17 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.13 2007/02/22 15:50:49 corecode Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -215,7 +215,7 @@ ext2_write(struct vop_write_args *ap) if (vp->v_type == VREG && td && td->td_proc && uio->uio_offset + uio->uio_resid > td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - ksignal(td->td_proc, SIGXFSZ); + lwpsignal(td->td_proc, td->td_lwp, SIGXFSZ); return (EFBIG); } diff --git a/sys/vfs/msdosfs/msdosfs_vnops.c b/sys/vfs/msdosfs/msdosfs_vnops.c index 20309d666c..c167e279a8 100644 --- a/sys/vfs/msdosfs/msdosfs_vnops.c +++ b/sys/vfs/msdosfs/msdosfs_vnops.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_vnops.c,v 1.95.2.4 2003/06/13 15:05:47 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.44 2006/12/23 00:41:29 swildner Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.45 2007/02/22 15:50:50 corecode Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -666,6 +666,7 @@ msdosfs_write(struct vop_write_args *ap) struct denode *dep = VTODE(vp); struct msdosfsmount *pmp = dep->de_pmp; struct proc *p = (td ? td->td_proc : NULL); + struct lwp *lp = (td ? td->td_lwp : NULL); #ifdef MSDOSFS_DEBUG kprintf("msdosfs_write(vp %p, uio %p, ioflag %x, cred %p\n", @@ -698,7 +699,7 @@ msdosfs_write(struct vop_write_args *ap) if (p && ((uoff_t)uio->uio_offset + uio->uio_resid > p->p_rlimit[RLIMIT_FSIZE].rlim_cur)) { - ksignal(p, SIGXFSZ); + lwpsignal(p, lp, SIGXFSZ); return (EFBIG); } diff --git a/sys/vfs/nfs/nfs_bio.c b/sys/vfs/nfs/nfs_bio.c index 8f65f9fdef..9a9a5b236e 100644 --- a/sys/vfs/nfs/nfs_bio.c +++ b/sys/vfs/nfs/nfs_bio.c @@ -35,7 +35,7 @@ * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 * $FreeBSD: /repoman/r/ncvs/src/sys/nfsclient/nfs_bio.c,v 1.130 2004/04/14 23:23:55 peadar Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.39 2006/12/23 00:41:29 swildner Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.40 2007/02/22 15:50:50 corecode Exp $ */ @@ -847,7 +847,7 @@ restart: */ if (td->td_proc && uio->uio_offset + uio->uio_resid > td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - ksignal(td->td_proc, SIGXFSZ); + lwpsignal(td->td_proc, td->td_lwp, SIGXFSZ); if (haverslock) nfs_rsunlock(np); return (EFBIG); diff --git a/sys/vfs/nwfs/nwfs_io.c b/sys/vfs/nwfs/nwfs_io.c index 0bb8b3ef6f..fc859c7962 100644 --- a/sys/vfs/nwfs/nwfs_io.c +++ b/sys/vfs/nwfs/nwfs_io.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_io.c,v 1.6.2.1 2000/10/25 02:11:10 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.23 2006/12/23 00:41:30 swildner Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.24 2007/02/22 15:50:50 corecode Exp $ * */ #include @@ -241,7 +241,7 @@ nwfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, if (uiop->uio_resid == 0) return 0; if (td->td_proc && uiop->uio_offset + uiop->uio_resid > td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - ksignal(td->td_proc, SIGXFSZ); + lwpsignal(td->td_proc, td->td_lwp, SIGXFSZ); return (EFBIG); } error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cred); diff --git a/sys/vfs/procfs/procfs_ctl.c b/sys/vfs/procfs/procfs_ctl.c index 3fbf81ed96..90f7b2a3d7 100644 --- a/sys/vfs/procfs/procfs_ctl.c +++ b/sys/vfs/procfs/procfs_ctl.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_ctl.c,v 1.20.2.2 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.13 2007/02/21 15:46:48 corecode Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.14 2007/02/22 15:50:50 corecode Exp $ */ #include @@ -154,7 +154,7 @@ procfs_control(struct proc *curp, struct lwp *lp, int op) p->p_oppid = p->p_pptr->p_pid; proc_reparent(p, curp); } - ksignal(p, SIGSTOP); + proc_stop(p, 1); return (0); } diff --git a/sys/vfs/smbfs/smbfs_io.c b/sys/vfs/smbfs/smbfs_io.c index c8074c0e52..8905517138 100644 --- a/sys/vfs/smbfs/smbfs_io.c +++ b/sys/vfs/smbfs/smbfs_io.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_io.c,v 1.3.2.3 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.27 2006/12/23 00:41:30 swildner Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.28 2007/02/22 15:50:50 corecode Exp $ * */ #include @@ -280,7 +280,7 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop, if (td->td_proc && uiop->uio_offset + uiop->uio_resid > td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - ksignal(td->td_proc, SIGXFSZ); + lwpsignal(td->td_proc, td->td_lwp, SIGXFSZ); return EFBIG; } smb_makescred(&scred, td, cred); diff --git a/sys/vfs/ufs/ufs_readwrite.c b/sys/vfs/ufs/ufs_readwrite.c index 642375e1b3..a69dba12ef 100644 --- a/sys/vfs/ufs/ufs_readwrite.c +++ b/sys/vfs/ufs/ufs_readwrite.c @@ -32,7 +32,7 @@ * * @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 * $FreeBSD: src/sys/ufs/ufs/ufs_readwrite.c,v 1.65.2.14 2003/04/04 22:21:29 tegge Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.20 2006/09/03 18:29:17 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.21 2007/02/22 15:50:50 corecode Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -285,7 +285,7 @@ ffs_write(struct vop_write_args *ap) if (vp->v_type == VREG && td && td->td_proc && uio->uio_offset + uio->uio_resid > td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - ksignal(td->td_proc, SIGXFSZ); + lwpsignal(td->td_proc, td->td_lwp, SIGXFSZ); return (EFBIG); } -- 2.41.0