Bug 221985 - "zfs mount -o remount" is broken
Summary: "zfs mount -o remount" is broken
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Alan Somers
URL:
Keywords:
Depends on: 222078
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-01 21:13 UTC by Alan Somers
Modified: 2018-02-20 18:43 UTC (History)
1 user (show)

See Also:
asomers: mfc-stable11+
asomers: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2017-09-01 21:13:38 UTC
The "remount" option to the "zfs mount" subcommand is not documented in the man page, but it is supported by Illumos.  It is used to temporarily change a filesystem's properties while the fs is mounted.

# On Illumos
$ mount | grep foo
/foo on foo read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=4350004 on Fri Sep  1 15:09:49 2017
$ sudo zfs mount -o remount,noatime foo
$ mount | grep foo
/foo on foo read/write/setuid/devices/nonbmand/exec/xattr/noatime/dev=4350004 on Fri Sep  1 15:10:06 2017


# On FreeBSD
> zfs mount -o remount,atime testpool
cannot mount 'testpool': mountpoint or dataset is busy
Comment 1 Andriy Gapon freebsd_committer 2017-09-04 11:05:21 UTC
(In reply to Alan Somers from comment #0)
I wonder if -o update would do what you want...
I believe that there is nothing ZFS-specific about 'remount', I think that it's just an illumos mount option equivalent to FreeBSD 'update' option.
Comment 2 commit-hook freebsd_committer 2017-09-05 19:41:03 UTC
A commit references this bug:

Author: asomers
Date: Tue Sep  5 19:40:04 UTC 2017
New revision: 323194
URL: https://svnweb.freebsd.org/changeset/base/323194

Log:
  Fix remounting ZFS filesystem with "zfs mount"

  "zfs mount -o" passes a list of mount options directly to nmount(2) after
  sanity checking them. In particular, zfs(8) will refuse to mount an already
  existing file system unless "remount" is specified in the option list.
  However, the "remount" option only exists in Illumos. FreeBSD's equivalent is
  "update".

  PR:		221985
  Reviewed by:	avg
  MFC after:	3 weeks
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D12233

Changes:
  head/sys/cddl/compat/opensolaris/sys/mntent.h
Comment 3 commit-hook freebsd_committer 2017-09-27 15:08:14 UTC
A commit references this bug:

Author: asomers
Date: Wed Sep 27 15:07:42 UTC 2017
New revision: 324062
URL: https://svnweb.freebsd.org/changeset/base/324062

Log:
  MFC r323194:

  Fix remounting ZFS filesystem with "zfs mount"

  "zfs mount -o" passes a list of mount options directly to nmount(2) after
  sanity checking them. In particular, zfs(8) will refuse to mount an already
  existing file system unless "remount" is specified in the option list.
  However, the "remount" option only exists in Illumos. FreeBSD's equivalent is
  "update".

  PR:		221985
  Reviewed by:	avg
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D12233

Changes:
_U  stable/11/
  stable/11/sys/cddl/compat/opensolaris/sys/mntent.h
Comment 4 commit-hook freebsd_committer 2017-11-28 17:33:40 UTC
A commit references this bug:

Author: asomers
Date: Tue Nov 28 17:33:11 UTC 2017
New revision: 326328
URL: https://svnweb.freebsd.org/changeset/base/326328

Log:
  MFC r323194:

  Fix remounting ZFS filesystem with "zfs mount"

  "zfs mount -o" passes a list of mount options directly to nmount(2) after
  sanity checking them. In particular, zfs(8) will refuse to mount an already
  existing file system unless "remount" is specified in the option list.
  However, the "remount" option only exists in Illumos. FreeBSD's equivalent is
  "update".

  PR:		221985
  Reviewed by:	avg
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D12233

Changes:
_U  stable/10/
  stable/10/sys/cddl/compat/opensolaris/sys/mntent.h
Comment 5 commit-hook freebsd_committer 2018-02-20 18:43:08 UTC
A commit references this bug:

Author: asomers
Date: Tue Feb 20 18:42:09 UTC 2018
New revision: 329652
URL: https://svnweb.freebsd.org/changeset/base/329652

Log:
  Update ZFS tests now that PR 221985 is fixed

  tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_003_pos.ksh
  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  	Convert Illumos syntax => FreeBSD syntax

  tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh
  	Clear expected failure for zfs_get_003_pos

  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  	Remove the "devices" property.  Unlike on Illumos, on FreeBSD it
  	can't be changed temporarily (or at all).

  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
  	Remove the expected failure for zfs_mount_007_pos due to 221985, but
  	add a new expected failure due to PR 115361.

  PR:		221985
  PR:		115361
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_003_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh