+2003-10-11 Ion Badulescu <ionut@moisil.badula.org>
+
+ Fix restarted filesystem by disabling the amfs_inherit filesystem
+ and moving the restarting logic into the generic code.
+
+ * amd/mntfs.c (locate_mntfs): disable amfs_inherit and simply
+ return the pointer to the restarted filesystem
+ (free_mntfs): check for the MFF_RESTART flag instead of the
+ amfs_inherit ops
+
+ * amd/autil.c (mf_mounted): remove the MFF_RESTART flag once the
+ filesystem is use
+
+ * amd/amfs_nfsx.c (amfs_nfsx_init): only call fs_init() if the
+ filesystem is not being restarted
+ (amfs_nfsx_remount): if the filesystem is already mounted,
+ short-circuit the code and just continue
+
+ * amd/amfs_generic.c (amfs_bgmount): only call fs_init() if the
+ filesystem is not being restarted; remove hack that was used to
+ work around an amfs_inherit problem
+
2003-10-09 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Use WebNFS to obtain file handles for mount(2).
back to v2/UDP if this doesn't work. The "webnfs" pseudo-mount options
has been renamed (again) to "public" to match Solaris 2.
+- restructured the restarting of already-mounted filesystems, in the process
+ also fixing a problem with restarting nfsx components
+
- bugs fixed:
* fixed nfsx support
- * fixed a race involving late replies to mountd, etc queries
+ * fixed a race involving late replies to network queries which
+ arrive after the filesystem has already been mounted
*** Notes specific to am-utils version 6.1b4
* SUCH DAMAGE.
*
*
- * $Id: amfs_generic.c,v 1.20 2003/10/09 05:13:58 ib42 Exp $
+ * $Id: amfs_generic.c,v 1.21 2003/10/12 00:49:46 ib42 Exp $
*
*/
else
mk_fattr(&mp->am_fattr, NFLNK);
- if (p->fs_init)
- this_error = (*p->fs_init) (mf);
+ if (p->fs_init && !(mf->mf_flags & MFF_RESTART))
+ this_error = p->fs_init(mf);
if (this_error > 0)
goto failed;
} else {
dlog("foreground mount of \"%s\" ...", mf->mf_mount);
this_error = mount_node((opaque_t) mp);
- /* do this again, it might have changed */
- mf = mp->am_mnt;
}
mf->mf_flags &= ~MFF_MOUNTING;
* SUCH DAMAGE.
*
*
- * $Id: amfs_nfsx.c,v 1.19 2003/10/09 05:13:58 ib42 Exp $
+ * $Id: amfs_nfsx.c,v 1.20 2003/10/12 00:49:46 ib42 Exp $
*
*/
amfs_nfsx_mnt *n = &nx->nx_v[i];
mntfs *m = n->n_mnt;
int error = 0;
- if (m->mf_ops->fs_init)
+ if (m->mf_ops->fs_init && !(mf->mf_flags & MFF_RESTART))
error = m->mf_ops->fs_init(m);
/*
* if you just "return error" here, you will have made a failure
if (m->mf_flags & MFF_MOUNTING)
break;
+ if (m->mf_flags & MFF_MOUNTED) {
+ mf_mounted(m);
+ n->n_error = glob_error = 0;
+ continue;
+ }
+
if (n->n_error < 0) {
/* Create the mountpoint, if and as required */
if (!(m->mf_flags & MFF_MKMNT) && m->mf_fsflags & FS_MKMNT) {
* SUCH DAMAGE.
*
*
- * $Id: autil.c,v 1.42 2003/10/09 05:13:58 ib42 Exp $
+ * $Id: autil.c,v 1.43 2003/10/12 00:49:46 ib42 Exp $
*
*/
mf->mf_fo = 0;
}
+ if (mf->mf_flags & MFF_RESTART) {
+ dlog("Restarted filesystem %s", mf->mf_mount);
+ mf->mf_flags &= ~MFF_RESTART;
+ }
+
/*
* Log message
*/
* SUCH DAMAGE.
*
*
- * $Id: mntfs.c,v 1.31 2003/08/27 16:30:04 ib42 Exp $
+ * $Id: mntfs.c,v 1.32 2003/10/12 00:49:46 ib42 Exp $
*
*/
}
if ((mf->mf_flags & MFF_RESTART) && amd_state == Run) {
+#if 0
/*
* Restart a previously mounted filesystem.
*/
mf2->mf_private = (voidp) dup_mntfs(mf);
mf2->mf_prfree = free_mntfs;
return mf2;
+#else
+ dlog("Restarting filesystem %s", mf->mf_mount);
+ return mf;
+#endif
}
mf->mf_fo = mo;
mntfs *mf2;
if (mf->mf_refc == 1 &&
- mf->mf_ops == &amfs_inherit_ops &&
+ mf->mf_flags & MFF_RESTART &&
STREQ(mf->mf_mount, mp)) {
/*
* If we are inheriting then just return