hjfs: fix potential deadlock in putloc()
This commit is contained in:
parent
b9bf9f1d54
commit
84ddc4cd4b
1 changed files with 6 additions and 0 deletions
|
@ -428,11 +428,17 @@ putloc(Fs *fs, Loc *l, int loop)
|
|||
while(loop && l != nil && l->ref <= 1){
|
||||
freeit:
|
||||
if((l->flags & LGONE) != 0){
|
||||
/*
|
||||
* safe to unlock here, the file is gone and
|
||||
* we'r the last reference.
|
||||
*/
|
||||
qunlock(&fs->loctree);
|
||||
b = getbuf(fs->d, l->blk, TDENTRY, 0);
|
||||
if(b != nil){
|
||||
delete(fs, l, b);
|
||||
putbuf(b);
|
||||
}
|
||||
qlock(&fs->loctree);
|
||||
}
|
||||
l->cnext->cprev = l->cprev;
|
||||
l->cprev->cnext = l->cnext;
|
||||
|
|
Loading…
Reference in a new issue