Hi,
This is just a thought that suddenly struck me, I figure I'll get it
out so I don't forget it.
On Fri, Jul 17, 2009 at 01:58:01PM +0300, Sergiu Ivanov wrote:
> +/* Shutdown the filesystem; flags are as for fsys_goaway. */
> +error_t
> +netfs_shutdown (int flags)
> +{
> + int nports;
> + int err;
> +
> + if ((flags & FSYS_GOAWAY_UNLINK)
> + && S_ISDIR (netfs_root_node->nn_stat.st_mode))
> + return EBUSY;
> +
> + /* Permit all current RPC's to finish, and then suspend any new ones. */
> + err = ports_inhibit_class_rpcs (netfs_protid_class);
> + if (err)
> + return err;
> +
> + nports = ports_count_class (netfs_protid_class);
> + if (((flags & FSYS_GOAWAY_FORCE) == 0) && nports)
> + /* There are outstanding user ports; resume operations. */
> + {
> + ports_enable_class (netfs_protid_class);
> + ports_resume_class_rpcs (netfs_protid_class);
> +
> + return EBUSY;
> + }
> +
> + if (!(flags & FSYS_GOAWAY_NOSYNC))
> + {
> + err = netfs_attempt_syncfs (0, flags);
> + if (err)
> + return err;
> + }
> +
> + /* If `shutting_down` is set, unionfs is going away because the
> + mounee has just died, so we don't need to attempt to shut it
> + down. */
> + if (!shutting_down)
> + {
> + shutting_down = 1;
> + err = fsys_goaway (mountee_control, flags);
> + if (err)
> + return err;
> + }
> +
> return 0;
> }
Shouldn't you resume operations if fsys_goaway returns EBUSY?
Regards,
Fredrik