]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r331616: vfs_donmount: in certain cases try r/o mount if r/w mount fails
authoravg <avg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 19 Apr 2018 05:52:47 +0000 (05:52 +0000)
committeravg <avg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 19 Apr 2018 05:52:47 +0000 (05:52 +0000)
commit1aaa9531bb1621a9d90ffc801955b750504816c9
treebc52f37b5a266ab6aa7f7a83083f198ffbbc12cf
parent0e89d57e0492e0708d7be861bb7087e28808374b
MFC r331616: 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.

stable/10 note: this branch does not have SYSCTL_BOOL, so SYSCTL_INT is
used instead.

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@332754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sbin/mount/mount.8
sys/kern/vfs_mount.c