Subject: Re: Uninitialised variable in ffs_mount()?
To: Anders Magnusson <ragge@ludd.luth.se>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 12/15/1999 10:08:45
Anders Magnusson wrote:

> > 
> > I agree that this is a problem; however, fs->fs_fsmnt isn't valid in
> > the "new mount" case until the copyinstr() on line 306.  (and I think
> > VFSTOUFS(mp) won't work until the ffs_mountfs is done).
> > 
> The MNT_ASYNC flag seems to be cleared after the call to ffs_mountfs()
> if it is a softdep filesystem, so the check is probably unneccessary.

I just had a chance to test this, and I get:

	# mount
	root_device on / type ffs (local, read-only)
	# mount -o async /dev/rz1c /mnt
	# mount
	root_device on / type ffs (local, read-only)
	/dev/rz1c on /mnt type ffs (local, soft dependencies)
	# mount -u -o async /mnt
	/mnt fs uses soft updates, ignoring async mode
	# mount
	root_device on / type ffs (local, read-only)
	/dev/rz1c on /mnt type ffs (local, soft dependencies)
	# 

so Ragge is correct.  The first few lines of softdep_mount() confirm
this.  So it looks like the correct fix is to delete the second
softdep/sync (ie the non-update case) altogether.  Is this a test that
could be "#ifdef DIAGNOSITIC"d?  It should never happen, but that's the
idea of DIAGNOSITIC tests (in which case we'd need to set up fs and
copyinstr() fs->fs_fsmnt to display a useful error message).

Simon.