cinap_lenrek [Fri, 6 Dec 2013 04:03:35 +0000 (05:03 +0100)]
libthread: avoid calling thread waiting for fork/execed process to finish if we dont have to
we do not need to wait for fork/execed program to finish when
not collecting waitmsg. this reduces the number of rio
processes hanging arround for each window shell just waiting
for it to terminate and then dumping the waitmsg.
cinap_lenrek [Thu, 28 Nov 2013 22:06:03 +0000 (23:06 +0100)]
u9fs: fix misuse of Fcall.afid in p9any authentication module. (from sources patch/u9fs-afid)
U9fs(4) misuses Fcall.afid in its p9any authentication module.
The afid field of Fcall structure is only valid with Tauth or Tattach.
Tread, Twrite, Tclunk should use rx->fid instead. It's been lucky so
far to get the job done because rx->afid survives from previous
Tauth/Tattach. The issue pops up when several authentications happen
concurrently.
Test case:
u9fs = 'host with u9fs on tcp!*!564'
9fs $u9fs; for(i in 1 2 3 4 5 6 7 8){ 9fs $u9fs & }; wait
Should:
no errors
Should not:
mount failed: authentication failed
cinap_lenrek [Mon, 25 Nov 2013 22:04:06 +0000 (23:04 +0100)]
abaco: make validurl() accept internationalized domain names
validurl() is just used to check if the string is a full
absolute url with a protocol scheme. we do not have to
match the host part *exactly*, only if there is *something*
in the hostpart.
cinap_lenrek [Fri, 22 Nov 2013 23:50:15 +0000 (00:50 +0100)]
kbdfs: add esc1+shift and esc1+ctrl pages (see sources kbmap-uk-weird patch)
Add pages for esc1+shift and esc1+ctrl - some UK USB keyboards (Dell) and it seems some
German ones: https://groups.google.com/forum/#!topic/comp.os.plan9/ycok6NTCWCg seem to
generate an esc1 + code scancode combination for the pipe/backslash key. Seems like
overkill to add two whole pages for just two keys, but there again RAM is cheap these days.
Probably should take the changes across to omap/kbd.c (and by extension bcm/kbd.c)
but the changes are trivial.
cinap_lenrek [Fri, 22 Nov 2013 18:19:37 +0000 (19:19 +0100)]
acme: fix arrow key oddity (thanks mark van atten and erik)
from 9atom/acmearrowfun patch:
reported by mark van atten
In Plan 9 acme, if you type
{}
then go back and type text between the brackets
{Curiouser and curiouser!}
the right arrow is blocked when you want to go over the closing
bracket to continue typing to its right. (If you first go to the left,
and then back to the right, it works.)
Same for the other brackets: [ ], ( ), < >.
noted that brackets are not necessary. same behavior with any
character.
cinap_lenrek [Sun, 17 Nov 2013 05:55:39 +0000 (06:55 +0100)]
ndb/dns: another attempt...
we have to fail the whole query that got no cached
nameservers and nameservers are looping, not just omit
the looping nameserver. issuequery() will refresh
nameserver info for the domain when recursing up.
cinap_lenrek [Sat, 16 Nov 2013 03:42:09 +0000 (04:42 +0100)]
ndb/dns: detect query loops
never try to resolve a nameserver address when that nameserver
is in the set of nameservers already being queried.
this situation can happen when the Ta and Taaaa RR's expire, but
the Tns records are still in the cache so there is no usable
nameserver but they still refer to each another.
cinap_lenrek [Fri, 15 Nov 2013 01:00:47 +0000 (02:00 +0100)]
ndb/dns: various changes
stop absolute/relative dual use of RR.ttl. now RR.ttl is
*always* the *relative* ttl value. we derive absolute
timeout in RR.expire.
remove unused lookuptime field in DN. replace refs and
keep with mark field in DN. we do not care about the
number of references. only *iff* it is referenced, so
use a single bit for that (bit 0). for keep, we use
bit 1.
remove dolock parameter in dnagenever(), it is not
needed. we always need to lock.
mark local dns servers and domains as never to be aged.
the keeper bit is *just* a cache optimization, preventing
the domain and the domains it points to from being flushed.
it should not be used as a write protect bit in rrattach()
for preventing spoofing as it will prevent updates of say,
cname domains.
remove "removing spam ..." message. these are usualy just
hints, so normal. still, remove the hint as we currently
do no check if the nameserver has authority over the
cname domain.
remove "mydnsquery: trying to send to myself (%s); bzzzt"
message. this can happen when myaddr() fails for other
reasons. myaddr() will print error for us anyway.
cinap_lenrek [Wed, 13 Nov 2013 17:44:45 +0000 (18:44 +0100)]
ndb/dns: case sensitive ndb attributes, Domlen consistency, dblookup() inplace lower case conversion, cleanups
ndb keys are strictly case sensitive, so consitently
use strcmp() when comparing attribute keys.
dblookup() used to lower case convert its name argument
inplace to match domain/sys name in ndb. better to do
the convesion in its own buffer and only read from the
name argument.
always use cistrcmp() when comparing DN.name.
the Domlen constant denotes the size of the buffer including
the null terminator. consistently use it as such.
have to hold dnlock in freearea() before reading list
head pointer.
cinap_lenrek [Fri, 8 Nov 2013 21:31:26 +0000 (22:31 +0100)]
kernel: make image cache not hold onto the channel, remove nocache flag
the image cache should not hold onto the text file channel
when not neccesary. now, the image keeps track of the number
of page cache references in Image.pgref. if the number of
page cache references and Image.ref are equal, this means
all the references to this image are from the page cache.
so no segments are using this image. in that case, we can
close the channel, but keep the Image in the hash table.
when attachimage() finds our image, it will check if Image.c
is nil and reattach the channel to the image before it is
used.
cinap_lenrek [Wed, 6 Nov 2013 21:18:36 +0000 (22:18 +0100)]
mp3dec: fix volume for mp3dec
the libmad samples need to be scaled properly. the
previous assumption was that it is 32 bits, but it
really is MAD_F_FRACTBITS + sign bit and rest used
for overflow.
mischief [Wed, 6 Nov 2013 19:22:15 +0000 (11:22 -0800)]
synchronize ape's vfprintf with libstdio
in ape's vfprintf we don't check if the file we're writing is actually a string buffer, resulting in a return of -1, when we should actually return the number of bytes that would be written.
cinap_lenrek [Sat, 2 Nov 2013 16:54:42 +0000 (17:54 +0100)]
rio: huge simplification of flush handling
xfidflush() now uses a simpler way to flush another xfid.
when we can send to Xfid.c channel, we know that the
xfid is completed. so all xfidflush() needs todo is to
do an alt sending to both Xfid.c and Xfid.flushc.
once the send to Xfid.c succeeds, we know the xfid is gone
and we can respond to the flush request.
theres no need to keep track of flush state anymore. so
Xfid.active and Xfid.flushing can be removed.
note, that it is ok to respond normally to a currently
flushed request.
cinap_lenrek [Fri, 1 Nov 2013 20:21:24 +0000 (21:21 +0100)]
rio: enforce flush reply ordering for all xfids
flushing isnt optional for concurrently handled requests.
we need to ensure that Rflush is replied *after* the
origianl request.
so we assign the flushtag for *every* xfid in xfidctl(),
and filsysrespond() checks if the xfid was flushed
*after* replying and wakes up the flushing xfid.
cinap_lenrek [Fri, 1 Nov 2013 17:57:11 +0000 (18:57 +0100)]
rio: properly handle follow up flushes (fixes unexpected reply tag)
when multiple flushes are send, they need to be replied
in order. we ensure this by having the flush xfid taking
over the flushtag (synchronized with a new fs->csyncflush
channel) so the next flush will flush the previous flush.
cinap_lenrek [Wed, 30 Oct 2013 20:24:44 +0000 (21:24 +0100)]
fix devshr related panic caused by Mount.to being nil (thanks mischief!)
the shr mount is linked into the Mhead with m->to initially nil. only
after the the server has been attached is m->to set. just check for
it in createdir().
cinap_lenrek [Fri, 25 Oct 2013 00:42:35 +0000 (02:42 +0200)]
kernel: disable freelist page caching for executables run from uncached mount
the image cache has the property of keeping a channel
for the executable binary arround which prevents the
mountpoint from going away.
this can easily be reproduced by running:
@{rfork n; ramfs; cp /bin/echo /tmp; /tmp/echo}
observe how ramfs stays arround until the image is
reclaimed. the echo binary is also cached but is
unreachable from any namespace.
we now restrict the caching to mounts that use the client
cache (-C flag) only. this should always be the case
for /bin. places where this isnt the case might observe
a performance regression.
cinap_lenrek [Thu, 24 Oct 2013 23:54:09 +0000 (01:54 +0200)]
kernel: keep one closeproc arround in case we are unable to fork a new one
closechanq() is unable to fork a new closeproc when palloc
is locked. so we spawn a closeproc early in chandevinit()
and make sure theres always one process arround to handle
the queue.