6333 ZFS should let the user specify or modify the fsid_guid of a dataset
Review Request #111 — Created Nov. 2, 2015 and updated
Information | |
---|---|
alecuyer | |
illumos-gate | |
Reviewers | |
general | |
This is useful if you need to migrate NFS clients from a target system to another, without having to umount/remount all clients.
The fsid_guid is used to construct the vfs_fsid when mounting a dataset. vfs_fsid is then used as the fh3_fsid by NFS when sharing the dataset.
Usage :
zfs create -o fsid_guid=xxx tank/test
or
zfs set fsid_guid=xxx tank/test
Tested:
- that the property is reflected in the VFS ID when mounting the dataset.
- that migrating NFS client from a source system to another system on which the dataset fsid_guid matches the source dataset works without needing to remount clients (no "Stale NFS file handle" errors).
- that you cannot assign a fsid_guid identical to a dataset that is currently mounted. If you assign a dataset a fsid_guid identical to a currently unmounted dataset, the latter will be assigned a new fsid_guid upon being mounted. (as already happens in the case of a "real" collision. See existing comment at the beginning of dsl_dataset_sync() )
-
-
-
usr/src/man/man1m/zfs.1m (Diff revision 1) If you want to start a new paragraph, insert .Pp between the lines.
-
-
transferring comments from email to here.
-
usr/src/lib/libzfs/common/libzfs_dataset.c (Diff revision 1) zfs_create(): what error does lzc_create() if you try to create a
filesystem that already exists?A. What if the dataset doesn't exist when zfs_dataset_exists() is called, and then another thread creates it before the lzc/ioctl is made?
B. The lzc_* interfaces should provide a good interface for all consumers, not just this one. If we use the same error code for 2 totally different types of error, it's hard to use.
-
usr/src/uts/common/fs/zfs/dsl_dataset.c (Diff revision 1) I assume it's OK to not manipulate the unique avl because we know this is not mounted. Can you add an assertion to that effect?
Actually, even not being mounted is not strong enough. It will be in the avl tree if the dataset_t exists at all (see where we call unique_insert()). You might need to manipulate the AVL after all, unless you can ensure that the dataset_t doesn't exist.
Change Summary:
Manpage formatting update, previous diff was reversed, sorry
Diff: |
Revision 3 (+3 -1) |
---|
Change Summary:
Use EBADF instead of EEXIST if fsid_guid is invalid or already used (zfs_ioc_set_prop and zfs_ioc_create do not currently use EBADF)
Diff: |
Revision 4 (+6 -4) |
---|