ref: 8569aecf35a6780be42eeda0cfbd4bf1d7bc8ee6
parent: a6e39b74fc0208413dd5b9f84bc54039d1504dd6
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jul 30 12:09:27 EDT 2022
bind, mount: stop returning mount id The mount ID is a sequence number in a 32 bit integer, which means that it can't be unique. This is largely harmless, because there is no way to use the mount id, beyond checking if it's negative. However, there's no overflow check, so the mount ID can wrap negative, which will break error checks on mount calls. Because it's useless, let's just stop returning it.
--- a/sys/man/2/bind
+++ b/sys/man/2/bind
@@ -224,8 +224,7 @@
.IR mnt (3),
.IR srv (3)
.SH DIAGNOSTICS
-The return value is a positive integer (a unique sequence number) for
-success, -1 for failure.
+The return value is 0 for success, -1 for failure.
These routines set
.IR errstr .
.SH BUGS
--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -745,13 +745,12 @@
}
m->mount = nm;
}
- order = nm->mountid;
wunlock(&m->lock);
wunlock(&pg->ns);
mountfree(um);
- return order;
+ return 0;
}
void
--
⑨