Commit Graph

5283 Commits

Author SHA1 Message Date
dsl 47799dd2af Move the place where we convert the return value of emulation lookups that
would return the emulation-root to the real root to the main exit path.
Means that lookups of both "/" and "/." get converted from "/emul/xxx" to "/".
2007-04-25 20:41:42 +00:00
dsl 0182ef09da When we return the real root instead of the emulated root, we may
not have the parent vnode for the emulated root - so dont vput() it.
May fix PR kern/36197.
2007-04-23 07:04:30 +00:00
dsl 2ad47f228f I'm not sure why I decided that cwdinit() shouldn't copy cwd_edir.
Since this is called in fork() it does rather need to give the child
process the parent's emulation root.
This means that (for example) an emulated shell will, by default, run
programs from the emulation root.
2007-04-22 18:41:49 +00:00
dsl b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
ad b0c22204d2 process_stoptrace: after setting a pending stop on curproc, call issignal
once to have it do the needful. PR kern/36161.
2007-04-19 22:42:10 +00:00
yamt 3829d825af malloc: fix a deadlock. 2007-04-19 11:03:44 +00:00
yamt 2c410c0431 sys_accept: fix usecount botch and double soclose in rev.1.108. 2007-04-18 10:20:02 +00:00
pooka 052ed1b786 wrap calls to pgsignal() in proclist_mutex 2007-04-17 19:52:56 +00:00
chs aba740b225 define a pager flag PGO_RECLAIM, similar to FSYNC_RECLAIM, and use it
to skip unnecessary flushing when layered file system vnodes are recycled.
this also prevents a deadlock with the dodgy LFS putpages routine.
fixes the non-LFS part of PR 36150.
2007-04-16 05:14:54 +00:00
yamt 2f6be2ad41 - soabort: don't leak a socket on error.
- add an assertion.
2007-04-15 05:25:48 +00:00
yamt db7c239cd4 sys_accept: don't leak a socket on error. 2007-04-15 05:25:02 +00:00
perseant 55307f6a04 Include the lwpid in the lock panic message, so we don't see silly messages
like
	lockmgr: pid 17, not exclusive lock holder 17 unlocking
2007-04-14 06:59:25 +00:00
ad c7f468e608 turnstile_wakeup: when restoring inherited priority, only lock curlwp
if its lock is sched_mutex. We can arrive here while on a sleep queue
(from eg cv_wait) and so curlwp will already be locked.
2007-04-10 13:11:08 +00:00
pooka f3fbb884a5 If mount(MNT_UPDATE) is called for a non-VROOT directory, don't vput()
the "mountpoint" vnode twice due to an error branch.

thanks go to Gert Doering for reporting the problem and testing the fix
and to Juergen Hannken-Illjes for much of the analysis work leading to
the discovery of the problem cause
2007-04-09 21:11:03 +00:00
gdt c2f4bcfa32 regen
(changes in RCS Ids only)
2007-04-09 15:00:42 +00:00
gdt bf25020786 vop_link: reorder commented arguments to match actual calling order
(dvp, vp).

ok wrstuden@
2007-04-09 14:58:28 +00:00
hannken fc6776f366 Remove now obsolete vn_start_write() and vn_finished_write() and
corresponding flags.

Revert softdep_trackbufs() to its state before vn_start_write() was added.

Remove from struct mount now unneeded flags IMNT_SUSPEND* and
members mnt_writeopcountupper, mnt_writeopcountlower and mnt_leaf.

Welcome to 4.99.17
2007-04-08 11:20:42 +00:00
rmind 1e2aad36da Revert the latest changes back to 1.25 rev. 2007-04-05 01:33:31 +00:00
rmind 330166a2eb Fix tbl, which was misstyped as tlb. 2007-04-04 11:01:10 +00:00
wrstuden db2a757990 Add a KASSERT to address CID: 4335.
Make sure that if we pull a buffer off of the read queue that it really
is a read request. Lower in this routine we base which queue we
dequeue the request from on its read/write state. Thus if a write
op ever ended up on the read queue, we'd explode (dereference NULL).
2007-04-04 02:30:43 +00:00
rmind 1db98c3723 socreate: l cannot be NULL.
CID: 4314
2007-04-03 23:44:53 +00:00
rmind 497adf4cc1 drvctlioctl: Plug a possible memory leak.
CID: 4363
2007-04-03 23:02:39 +00:00
rmind 5174ef0ece fileassoc_file_delete: Handle an error case of fileassoc_table_lookup().
CID: 4431
2007-04-03 22:29:23 +00:00
hannken 0adf7298aa Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-03 16:11:31 +00:00
yamt ef47d5b67e - don't use veriexec_mountspecific_key uninitialized.
- fix weird "Veriexec: IDS mode, allowing unmount" messages.
2007-04-03 09:17:31 +00:00
christos 7074d009d5 Don't panic if we don't find a symbol or string table. Perhaps the kernel
has been stripped?
2007-04-02 16:44:44 +00:00
hannken 13daf5bc6e Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-01 10:15:01 +00:00
ad 0ac3a31ea3 Cosmetic changes. 2007-03-30 11:06:58 +00:00
ad 3d5b66ed02 Always include kernel_lock so that LOCKDEBUG checks can find the symbol. 2007-03-30 11:05:59 +00:00
ad 5714ab2718 Make cv_has_waiters() return type bool. 2007-03-29 17:39:34 +00:00
ad 79da439b94 - cv_wakeup, cv_broadcast -> cv_signal where appropriate
- Update some comments.
2007-03-29 17:37:13 +00:00
ad 4911263df8 cv_wakeup -> cv_signal 2007-03-29 17:35:17 +00:00
ad 6cf46baa77 - cv_wakeup: remove this. There are ~zero situations where it's useful.
- cv_wait and friends: after resuming execution, check to see if we have
  been restarted as a result of cv_signal. If we have, but cannot take
  the wakeup (because of eg a pending Unix signal or timeout) then try to
  ensure that another LWP sees it. This is necessary because there may
  be multiple waiters, and at least one should take the wakeup if possible.
  Prompted by a discussion with pooka@.
- typedef struct lwp lwp_t;
- int -> bool, struct lwp -> lwp_t in a few places.
2007-03-29 17:34:39 +00:00
hubertf 3bfc0c42ee Remove duplicate #include's
From: Slava Semushin <php-coder@altlinux.ru>
2007-03-26 22:52:44 +00:00
rmind 7b9af0160d Handle newlwp() error case. Currently, newlwp() cannot fail, but this
will likely change in the future.
2007-03-24 16:43:56 +00:00
ad bb25376cda Fix a deadlock w/kqueue that was introduced with the last set of changes.
Spotted by yamt@.
2007-03-23 18:33:43 +00:00
dsl f99253cbf6 Somehow a single K&R function definition was lurking - nuke it. 2007-03-21 21:18:56 +00:00
ad fed1793605 Improvements to lwp_wait1(), for PR kern/35932:
- Better detect simple cycles of threads calling _lwp_wait and return
  EDEADLK. Does not handle deeper cycles like t1 -> t2 -> t3 -> t1.
- If there are multiple threads in _lwp_wait, then make sure that
  targeted waits take precedence over waits for any LWP to exit.
- When checking for deadlock, also count the number of zombies currently
  in the process as potentially reapable. Whenever a zombie is murdered,
  kick all waiters to make them check again for deadlock.
- Add more comments.

Also, while here:

- LOCK_ASSERT -> KASSERT in some places
- lwp_free: change boolean arguments to type 'bool'.
- proc_free: let lwp_free spin waiting for the last LWP to exit, there's
  no reason to do it here.
2007-03-21 18:25:59 +00:00
ad e0fd341348 Changes to LWP wakeup:
- Don't bother sorting the sleep queues, since user space controls the
  order of removal.
- Change setrunnable(t) to lwp_unsleep(t). No functional change from the
  perspective of user applications.
- Minor cosmetic changes.
2007-03-20 23:25:17 +00:00
skrll 335ac44f76 Restore previous semantics of PT_LWPINFO and make sure to lwp_addref the
LWP.

OK'ed by ad.
2007-03-15 20:55:15 +00:00
ad 1b83cbc3d6 sodopendfreel: Getting a bit over ambitious.. Go to splvm() before calling
pool_cache_put().
2007-03-15 16:28:31 +00:00
ad 06aeb1d344 - Remove the LWP counters. The race between park/unpark rarely occurs
so it's not worth counting.

- lwp_wakeup: set LW_UNPARKED on the target. Ensures that _lwp_park will
  always be awoken even if another system call eats the wakeup, e.g. as a
  result of an intervening signal. To deal with this correctly for other
  system calls will require a different approach.

- _lwp_unpark, _lwp_unpark_all: use setrunnable if the LWP is not parked
  on the same sync queue: (1) simplifies the code a bit as there no point
  doing anything special for this case (2) makes it possible for p_smutex
  to be replaced by p_mutex and (3) restores the guarantee that the 'hint'
  argument really is just a hint.
2007-03-14 23:58:24 +00:00
yamt b84c74b2d4 sys__lwp_park: whitespace. no functional change. 2007-03-14 23:07:27 +00:00
yamt b1b0d0db04 sys__lwp_park: don't restart on signals. PR/35969 from Andrew Doran. 2007-03-14 23:00:32 +00:00
dyoung 3cd3acad77 Exclude some files that replicate NetBSD typedefs and #defines. 2007-03-14 17:20:22 +00:00
ad 19ae9745a3 Don't call pipe_init if PIPE_SOCKETPAIR is defined. 2007-03-13 17:23:49 +00:00
ad 883bea1471 Revert previous now that simplelock.h has been fixed. 2007-03-13 15:59:47 +00:00
dogcow 592f917095 now that simple_lock is a define elsewhere as well, #undef it in the
regress case.
2007-03-13 13:25:57 +00:00
thorpej 217c6e4c0e Return EEXIST if attempting to install a RAS that is already installed. 2007-03-13 04:44:06 +00:00
ad a240617e8c msgctl1: fix a lock leak. 2007-03-13 03:43:54 +00:00