freebsd-skq/sys/fs
Bruce Evans 4eb3abf0a5 Make using msdosfs as the root file system sort of work:
o Initialize ownerships and permissions.  They were garbage (0) for
  root mounts since vfs_mountroot_try() doesn't ask for them to be set
  and msdosfs's old incomplete code to set them was removed.  The
  garbage happened to give the correct ownerships root:wheel, but it
  gave permissions 000 so init could not be execed.  Use the macros
  for root: wheel and 0755.  (The removed code gave 0:0 and 0777.  0755
  is more normal and secure, thought wrong for /tmp.)

o Check the readonly flag for initial (non-MNT_UPDATE) mounts in the
  correct place, as in ffs.  For root mounts, it is only passed in
  mp->mnt_flags, since vfs_mountroot_try() only passes it as a flag
  and nothing translates the flag to the "ro" option string.  msdosfs
  only looked for it in the string, so it gave a rw mount for root
  mounts without even clearing the flag in mp->mnt_flags, so the final
  state was inconsistent.  Checking the flag only in mp->mnt_flags
  works for initial userland mounts too.  The MNT_UPDATE case is
  messier.

The main point that should work but doesn't is fsck of msdosfs root
while it is mounted ro.  This needs mainly MNT_RELOAD support to work.
It should be possible to run fsck -p and succeed provided the fs is
consistent, not just for msdosfs, but this fails because fsck -p always
tries to open the device rw.  The hack that allows open for writing
in ffs is not implemented in msdosfs, since without MNT_RELOAD support
writing could only be harmful.  So fsck must be turned off to use
msdosfs as root.  This is quite dangerous, since msdosfs is still missing
actually using its fs-dirty flag internally, so it is happy to mount
dirty fileystems rw.

Unrelated changes:
- Fix missing error handling for MNT_UPDATE from rw to ro.
- Catch up with renaming msdos to msdosfs in a string.

Approved by:	re (kensmith)
2007-07-23 07:10:17 +00:00
..
cd9660 Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
coda Make sure we release the control vnode in Coda: 2007-07-20 11:14:51 +00:00
deadfs Below is slightly edited description of the LOR by Tor Egge: 2007-01-22 11:25:22 +00:00
devfs Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls 2007-07-03 17:42:37 +00:00
fdescfs Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
fifofs Revert UF_OPENING workaround for CURRENT. 2007-05-31 11:51:53 +00:00
hpfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
msdosfs Make using msdosfs as the root file system sort of work: 2007-07-23 07:10:17 +00:00
ntfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
nullfs Where I previously removed calls to kdb_enter(), now remove include of 2007-05-29 11:28:28 +00:00
nwfs Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation 2007-06-01 14:33:11 +00:00
portalfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
procfs Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in 2007-06-12 00:12:01 +00:00
pseudofs Fix off-by-one error (introduced in r1.60) that had the effect of 2007-06-07 15:04:30 +00:00
smbfs Do proper "locking" for missing vmmeters part. 2007-06-04 21:45:18 +00:00
tmpfs MFp4: When swapping is not enabled, allow creating files by taking 2007-07-23 06:54:58 +00:00
udf Correct corrupt read when the read starts at a non-aligned offset. 2007-06-11 20:14:44 +00:00
unionfs Revert UF_OPENING workaround for CURRENT. 2007-05-31 11:51:53 +00:00