HomeFreeBSD

Add MS_MANDLOCK mount failure message

Description

Add MS_MANDLOCK mount failure message

Commit torvalds/linux@9e8925b6 allowed for kernels to be built
without support for mandatory locking (MS_MANDLOCK). This will
result in 'zfs mount' failing when the nbmand=on property is set
if the kernel is built without CONFIG_MANDATORY_FILE_LOCKING.

Unfortunately we can not reliably detect prior to the mount(2) system
call if the kernel was built with this support. The best we can do
is check if the mount failed with EPERM and if we passed 'mand'
as a mount option and then print a more useful error message. e.g.

  filesystem 'tank/fs' has the 'nbmand=on' property set, this mount
  option may be disabled in your kernel.  Use 'zfs set nbmand=off'
  to disable this option and try to mount the filesystem again.

Additionally, switch the default error message case to use
strerror() to produce a more human readable message.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4729
Closes #6199

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jun 7 2017, 5:59 PM
GitHub <noreply@github.com>Committed on Jun 7 2017, 5:59 PM
Parents
rG829aaf280171: Skip tests that are slow on 32-bit builders
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG4070bfd85282: Add MS_MANDLOCK mount failure message (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jun 7 2017, 5:59 PM