summaryrefslogtreecommitdiff
path: root/devio
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-27 16:32:39 +0000
committerMiles Bader <miles@gnu.org>1996-01-27 16:32:39 +0000
commit3512fe0b86990b27c72d4a8c04402f804c42bc48 (patch)
tree44d1f3b44c9f8d46f65d0dd8c532869397fee577 /devio
parent7f21b7ddedaa28d05bcefd82d74781f7e122af6a (diff)
(trivfs_goaway):
Handle errors from ports_inhibit_class_rpcs. Allow rpcs to resume if we're going to return EBUSY.
Diffstat (limited to 'devio')
-rw-r--r--devio/devio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/devio/devio.c b/devio/devio.c
index d0f2b9fb..f1eb428a 100644
--- a/devio/devio.c
+++ b/devio/devio.c
@@ -271,6 +271,7 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st)
error_t
trivfs_goaway (struct trivfs_control *fsys, int flags)
{
+ error_t err;
int force = (flags & FSYS_GOAWAY_FORCE);
int nosync = (flags & FSYS_GOAWAY_NOSYNC);
@@ -280,7 +281,12 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
exit (0);
/* Wait until all pending rpcs are done. */
- ports_inhibit_class_rpcs (root_port_class);
+ err = ports_inhibit_class_rpcs (root_port_class);
+ if (err == EINTR || (err && !force))
+ {
+ mutex_unlock (&device_lock);
+ return err;
+ }
if (force && nosync)
/* Exit with extreme prejudice. */
@@ -310,6 +316,7 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
busy:
/* Allow normal operations to proceed. */
ports_enable_class (root_port_class);
+ ports_resume_class_rpcs (root_port_class);
mutex_unlock(&device_lock);
/* Complain that there are still users. */