summaryrefslogtreecommitdiff
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
commit0de2a41da1be00201e65a2cec1d80ae1bc550722 (patch)
tree1c1e320e8e7c1cb8496ab59a5c36cf5b18cbd10c
parent4abfbe4f0d351e27eb35b2c5a91d6833283bb0e4 (diff)
(trivfs_goaway):
Handle errors from ports_inhibit_class_rpcs. Allow rpcs to resume if we're going to return EBUSY.
-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. */