9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH] exportfs: fix clunk of first attach with -S
Date: Sun, 16 Oct 2022 19:35:30 +0000	[thread overview]
Message-ID: <71D81C816314EDF35CE6A906B468E97B@mforney.org> (raw)


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;	
 }

             reply	other threads:[~2022-10-16 19:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 19:35 Michael Forney [this message]
2022-10-16 22:04 ` ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71D81C816314EDF35CE6A906B468E97B@mforney.org \
    --to=mforney@mforney.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).