Unified · Split
| @@ -127,7 +127,6 @@ kickit(void) · 126 unmodified lines | ||
| 127 | 127 | DPRINT(DERR, "*ERROR*: Problem with cloneproc\n"); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | − chanclose(pidc); | |
| 131 | 130 | chanfree(pidc); |
| 132 | 131 | |
| 133 | 132 | return pid; |
| @@ -328,9 +327,7 @@ fsclunk(Fid *f) · 194 unmodified lines | ||
| 328 | 327 | static void |
| 329 | 328 | cleanup(Srv *) |
| 330 | 329 | { |
| 331 | − chanclose(iochan); | |
| 332 | 330 | chanfree(iochan); |
| 333 | − chanclose(clunkchan); | |
| 334 | 331 | chanfree(clunkchan); |
| 335 | 332 | free(srvctl); |
| 336 | 333 | threadexitsall("done"); |
| @@ -775,7 +775,6 @@ releasesessions(Gang *g) · 774 unmodified lines | ||
| 775 | 775 | |
| 776 | 776 | for(count = 0; count < g->size; count++) { |
| 777 | 777 | free(g->sess[count].path); |
| 778 | − chanclose(g->sess[count].chan); | |
| 779 | 778 | chanfree(g->sess[count].chan); |
| 780 | 779 | close(g->sess[count].fd); |
| 781 | 780 | } |
| @@ -221,7 +221,6 @@ usage(void) · 220 unmodified lines | ||
| 221 | 221 | static void |
| 222 | 222 | killall(Srv*) |
| 223 | 223 | { |
| 224 | − chanclose(iochan); | |
| 225 | 224 | chanfree(iochan); |
| 226 | 225 | threadexitsall("killall"); |
| 227 | 226 | } |
| @@ -356,11 +355,9 @@ closebcasts(Mpipe *mp) · 128 unmodified lines | ||
| 356 | 355 | { |
| 357 | 356 | Fidaux *c; |
| 358 | 357 | |
| 359 | − qlock(&mp->l); | |
| 360 | 358 | for(c=mp->bcastr; c != nil; c=c->next) { |
| 361 | 359 | chanclose(c->chan); |
| 362 | 360 | } |
| 363 | − qunlock(&mp->l); | |
| 364 | 361 | } |
| 365 | 362 | |
| 366 | 363 | /* process mount options */ |
| @@ -503,8 +500,10 @@ fsclunk(Fid *fid) · 136 unmodified lines | ||
| 503 | 500 | /* writer accounting and cleanup */ |
| 504 | 501 | if((fid->omode&OMASK) == OWRITE) { |
| 505 | 502 | /* TODO: what do we do with outstanding requests? */ |
| 503 | + DPRINT(DWRT, "---- fid %d writers now %d\n", fid->fid, mp->writers-1); | |
| 504 | + qlock(&mp->l); | |
| 506 | 505 | mp->writers--; |
| 507 | − DPRINT(DWRT, "---- fid %d writers now %d\n", fid->fid, mp->writers); | |
| 506 | + | |
| 508 | 507 | if((aux->state != FID_CTLONLY) && (mp->writers == 0)) { |
| 509 | 508 | for(count=0;count < mp->slots; count++) |
| 510 | 509 | if(mp->rrchan[count]) { |
| @@ -514,6 +513,7 @@ fsclunk(Fid *fid) · 3 unmodified lines | ||
| 514 | 513 | if(mp->mode == MPTbcast) |
| 515 | 514 | closebcasts(mp); |
| 516 | 515 | } |
| 516 | + qunlock(&mp->l); | |
| 517 | 517 | |
| 518 | 518 | free(aux); |
| 519 | 519 | fid->aux = nil; |
| @@ -902,7 +902,6 @@ fsbcast(Req *r, Mpipe *mp) · 382 unmodified lines | ||
| 902 | 902 | if(!err) |
| 903 | 903 | r->ofcall.count = r->ifcall.count; |
| 904 | 904 | |
| 905 | − chanclose(reterr); | |
| 906 | 905 | chanfree(reterr); |
| 907 | 906 | |
| 908 | 907 | return err; |
| @@ -1056,7 +1055,6 @@ parseheader(Req *r, Mpipe *mp, Fidaux *aux) · 147 unmodified lines | ||
| 1056 | 1055 | else |
| 1057 | 1056 | proccreate(splicefrom, sa, STACK); |
| 1058 | 1057 | err = recvp(sa->chan); /* sync */ |
| 1059 | − chanclose(sa->chan); | |
| 1060 | 1058 | chanfree(sa->chan); |
| 1061 | 1059 | return err; |
| 1062 | 1060 | break; |
| @@ -290,6 +290,52 @@ fn spliceto { · 289 unmodified lines | ||
| 290 | 290 | rm -rf $TESTDIR/* |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | +# | |
| 294 | +# splice to chain to tests problem | |
| 295 | +# experienced using multinode gangfs | |
| 296 | +# | |
| 297 | + | |
| 298 | +fn splicetochain { | |
| 299 | + echo -n Testing spliceto chains... | |
| 300 | + | |
| 301 | + # initialize test files | |
| 302 | + echo Hello Squidboy > $TESTDIR/test | |
| 303 | + echo > $TESTDIR/test1 | |
| 304 | + | |
| 305 | + # accomplish the test | |
| 306 | + # stage0 and stage1 feeds stage2 which feeds stage3 | |
| 307 | + mount /srv/mpipe /n/stage0 s0 | |
| 308 | + mount /srv/mpipe /n/stage1 s1 | |
| 309 | + mount /srv/mpipe /n/stage2 s2 | |
| 310 | + mount /srv/mpipe /n/stage3 s3 | |
| 311 | + mp-writer -o /n/stage2/s2 /n/stage0/s0 | |
| 312 | + mp-writer -o /n/stage2/s2 /n/stage1/s1 | |
| 313 | + mp-writer -o /n/stage3/s3 /n/stage2/s2 | |
| 314 | + mp-writer -o $TESTDIR/test1 /n/stage3/s3 | |
| 315 | + echo one > /n/stage0/s0 & | |
| 316 | + echo two > /n/stage1/s1 & | |
| 317 | + | |
| 318 | + sleep 1 | |
| 319 | + | |
| 320 | + unmount /n/stage0 | |
| 321 | + unmount /n/stage1 | |
| 322 | + unmount /n/stage2 | |
| 323 | + unmount /n/stage3 | |
| 324 | + | |
| 325 | + # verify results | |
| 326 | + echo one > $TESTDIR/test2 | |
| 327 | + echo two >> $TESTDIR/test2 | |
| 328 | + if(! cmp -s $TESTDIR/test2 $TESTDIR/test1) { | |
| 329 | + echo FAILED: test1 not equal to test2 | |
| 330 | + exit 'splicetochain: failed' | |
| 331 | + } | |
| 332 | + | |
| 333 | + echo Success! | |
| 334 | + | |
| 335 | + # cleanup | |
| 336 | + rm -rf $TESTDIR/* | |
| 337 | +} | |
| 338 | + | |
| 293 | 339 | # |
| 294 | 340 | # Broadcast spliceto test |
| 295 | 341 | # |
| @@ -342,6 +388,7 @@ splicefrom · 46 unmodified lines | ||
| 342 | 388 | spliceto |
| 343 | 389 | splicetobcast |
| 344 | 390 | splicefrombcast |
| 391 | +splicetochain | |
| 345 | 392 | |
| 346 | 393 | # Cleanup |
| 347 | 394 | rm -f $TESTDIR |