diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-04-28 06:55:06 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-04-28 06:55:06 +0200 |
commit | 40b6959788d35d66c5d4580730ac294f0d4c34f4 (patch) | |
tree | c1c0259ba1f19f7bf0ec2f1100e2c3c343e09c8b /sys/src | |
parent | 2c2a71cd515dbd28a87b4ae85080775675a3e135 (diff) |
devmnt: make abandoning fid on botched clunk handle flushes
make mntflushfree() return the original rpc and do the
botched clunk check on the original instead of the
current rpc.
so if we get a botched flush of a clunk, we abandon the
fid of the channel as well.
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/port/devmnt.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/src/9/port/devmnt.c b/sys/src/9/port/devmnt.c index d073b7064..cce379095 100644 --- a/sys/src/9/port/devmnt.c +++ b/sys/src/9/port/devmnt.c @@ -58,7 +58,7 @@ struct Mntalloc Mnt* mntchk(Chan*); void mntdirfix(uchar*, Chan*); Mntrpc* mntflushalloc(Mntrpc*, ulong); -void mntflushfree(Mnt*, Mntrpc*); +Mntrpc* mntflushfree(Mnt*, Mntrpc*); void mntfree(Mntrpc*); void mntgate(Mnt*); void mntqrm(Mnt*, Mntrpc*); @@ -777,6 +777,7 @@ mountio(Mnt *m, Mntrpc *r) if(m->rip == up) mntgate(m); if(strcmp(up->errstr, Eintr) != 0){ + r = mntflushfree(m, r); switch(r->request.type){ case Tremove: case Tclunk: @@ -784,7 +785,6 @@ mountio(Mnt *m, Mntrpc *r) if(strcmp(up->errstr, Ehungup) != 0) r->c->fid = 0; } - mntflushfree(m, r); nexterror(); } r = mntflushalloc(r, m->msize); @@ -1007,9 +1007,9 @@ mntflushalloc(Mntrpc *r, ulong iounit) * flush and the original message from the unanswered * request queue. Mark the original message as done * and if it hasn't been answered set the reply to to - * Rflush. + * Rflush. Return the original rpc. */ -void +Mntrpc* mntflushfree(Mnt *m, Mntrpc *r) { Mntrpc *fr; @@ -1020,10 +1020,12 @@ mntflushfree(Mnt *m, Mntrpc *r) r->reply.type = Rflush; mntqrm(m, r); } - if(fr) - mntfree(r); + if(fr == nil) + break; + mntfree(r); r = fr; } + return r; } int |