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.
This commit is contained in:
parent
2c2a71cd51
commit
40b6959788
1 changed files with 8 additions and 6 deletions
|
@ -58,7 +58,7 @@ struct Mntalloc
|
||||||
Mnt* mntchk(Chan*);
|
Mnt* mntchk(Chan*);
|
||||||
void mntdirfix(uchar*, Chan*);
|
void mntdirfix(uchar*, Chan*);
|
||||||
Mntrpc* mntflushalloc(Mntrpc*, ulong);
|
Mntrpc* mntflushalloc(Mntrpc*, ulong);
|
||||||
void mntflushfree(Mnt*, Mntrpc*);
|
Mntrpc* mntflushfree(Mnt*, Mntrpc*);
|
||||||
void mntfree(Mntrpc*);
|
void mntfree(Mntrpc*);
|
||||||
void mntgate(Mnt*);
|
void mntgate(Mnt*);
|
||||||
void mntqrm(Mnt*, Mntrpc*);
|
void mntqrm(Mnt*, Mntrpc*);
|
||||||
|
@ -777,6 +777,7 @@ mountio(Mnt *m, Mntrpc *r)
|
||||||
if(m->rip == up)
|
if(m->rip == up)
|
||||||
mntgate(m);
|
mntgate(m);
|
||||||
if(strcmp(up->errstr, Eintr) != 0){
|
if(strcmp(up->errstr, Eintr) != 0){
|
||||||
|
r = mntflushfree(m, r);
|
||||||
switch(r->request.type){
|
switch(r->request.type){
|
||||||
case Tremove:
|
case Tremove:
|
||||||
case Tclunk:
|
case Tclunk:
|
||||||
|
@ -784,7 +785,6 @@ mountio(Mnt *m, Mntrpc *r)
|
||||||
if(strcmp(up->errstr, Ehungup) != 0)
|
if(strcmp(up->errstr, Ehungup) != 0)
|
||||||
r->c->fid = 0;
|
r->c->fid = 0;
|
||||||
}
|
}
|
||||||
mntflushfree(m, r);
|
|
||||||
nexterror();
|
nexterror();
|
||||||
}
|
}
|
||||||
r = mntflushalloc(r, m->msize);
|
r = mntflushalloc(r, m->msize);
|
||||||
|
@ -1007,9 +1007,9 @@ mntflushalloc(Mntrpc *r, ulong iounit)
|
||||||
* flush and the original message from the unanswered
|
* flush and the original message from the unanswered
|
||||||
* request queue. Mark the original message as done
|
* request queue. Mark the original message as done
|
||||||
* and if it hasn't been answered set the reply to to
|
* 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)
|
mntflushfree(Mnt *m, Mntrpc *r)
|
||||||
{
|
{
|
||||||
Mntrpc *fr;
|
Mntrpc *fr;
|
||||||
|
@ -1020,10 +1020,12 @@ mntflushfree(Mnt *m, Mntrpc *r)
|
||||||
r->reply.type = Rflush;
|
r->reply.type = Rflush;
|
||||||
mntqrm(m, r);
|
mntqrm(m, r);
|
||||||
}
|
}
|
||||||
if(fr)
|
if(fr == nil)
|
||||||
|
break;
|
||||||
mntfree(r);
|
mntfree(r);
|
||||||
r = fr;
|
r = fr;
|
||||||
}
|
}
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue