freebsd-skq/sbin/mount
Andriy Gapon 31260bf042 vfs_donmount: in certain cases try r/o mount if r/w mount fails
If the operation is not an update, if neither r/w nor r/o mode is
explicitly requested, if the error code hints at the possibility of the
media being read-only, and if the fallback is allowed, then we can try
to automatically downgrade to the readonly mode.

This is especially useful for auto-mounting of removable media that
sometimes can happen to be write-protected.

The fallback to r/o is not enabled by default.  It can be requested on a
per-mount basis with a new mount option, 'autoro'.  Or it can be
globally allowed by setting vfs.default_autoro.

Reviewed by:	cem, kib
MFC after:	3 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D13361
2018-03-27 14:31:42 +00:00
..
extern.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
getmntopts.3 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
getmntopts.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
Makefile Move mount.conf(8) to mount.conf(5); it's a kernel configuration file 2017-05-28 18:07:53 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mntopts.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
mount_fs.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
mount.8 vfs_donmount: in certain cases try r/o mount if r/w mount fails 2018-03-27 14:31:42 +00:00
mount.c Remove decade's old whine about msdos vs msdosfs. 2018-03-09 21:32:07 +00:00
pathnames.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
vfslist.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00