9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] exportfs: fix clunk of first attach with -S
@ 2022-10-16 19:35 Michael Forney
  2022-10-16 22:04 ` ori
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Forney @ 2022-10-16 19:35 UTC (permalink / raw)
  To: 9front


0 is a valid mid so should not be used as a nil value, since then the
first mount (mid=0) will never be unmounted.
---
diff 8e2c59136fe37143189f1dca81f53d7c6e11463f a8f8a2e401734a83dc6f098bf57dd4ae5b0f815b
--- a/sys/src/cmd/exportfs/io.c
+++ b/sys/src/cmd/exportfs/io.c
@@ -119,7 +119,7 @@
 	l = &fidhash(nr);
 	for(f = *l; f != nil; f = f->next) {
 		if(f->nr == nr) {
-			if(f->mid) {
+			if(f->mid != -1) {
 				snprint(buf, sizeof(buf), "/mnt/exportfs/%d", f->mid);
 				unmount(0, buf);
 				psmap[f->mid] = 0;
@@ -171,7 +171,7 @@
 	*l = new;
 	new->nr = nr;
 	new->fid = -1;
-	new->mid = 0;
+	new->mid = -1;
 
 	return new;	
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] [PATCH] exportfs: fix clunk of first attach with -S
  2022-10-16 19:35 [9front] [PATCH] exportfs: fix clunk of first attach with -S Michael Forney
@ 2022-10-16 22:04 ` ori
  0 siblings, 0 replies; 2+ messages in thread
From: ori @ 2022-10-16 22:04 UTC (permalink / raw)
  To: 9front

Quoth Michael Forney <mforney@mforney.org>:
> 
> 0 is a valid mid so should not be used as a nil value, since then the
> first mount (mid=0) will never be unmounted.

ok by me.

> ---
> diff 8e2c59136fe37143189f1dca81f53d7c6e11463f a8f8a2e401734a83dc6f098bf57dd4ae5b0f815b
> --- a/sys/src/cmd/exportfs/io.c
> +++ b/sys/src/cmd/exportfs/io.c
> @@ -119,7 +119,7 @@
>  	l = &fidhash(nr);
>  	for(f = *l; f != nil; f = f->next) {
>  		if(f->nr == nr) {
> -			if(f->mid) {
> +			if(f->mid != -1) {
>  				snprint(buf, sizeof(buf), "/mnt/exportfs/%d", f->mid);
>  				unmount(0, buf);
>  				psmap[f->mid] = 0;
> @@ -171,7 +171,7 @@
>  	*l = new;
>  	new->nr = nr;
>  	new->fid = -1;
> -	new->mid = 0;
> +	new->mid = -1;
>  
>  	return new;	
>  }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-16 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 19:35 [9front] [PATCH] exportfs: fix clunk of first attach with -S Michael Forney
2022-10-16 22:04 ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).