Project

General

Profile

Actions

Bug #13910

open

"zfs set sharesmb/nfs" lists all snapshots unnecessarily

Added by Alex Wilson 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Currently when you do zfs set sharesmb=on ... or zfs set sharenfs=on ..., the code in zfs_prop_set_list calls changelist_gather to build up a list of datasets and snapshots that need to be remounted or changed after the actual property change is complete. This is common code used by both the code for zfs set share* and zfs set mountpoint. When handling a share* property, eventually changelist_postfix will be called, which will then call zfs_share_smb/nfs on each of the children found by changelist_gather.

In zfs_share_smb/nfs (or, rather in zfs_share_proto which they both call) we immediately return 0 if !zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL). ZFS snapshots always return false from zfs_is_mountable (since they can't have their own mountpoint). So, when we're handling a share* property, there's no point to gathering up the list of all the snapshots. We might as well just call zfs_iter_filesystems in changelist_gather in this case.

At UQ we have machines which have thousands of snapshots on a lot of datasets but no filesystem children. Setting sharesmb or sharenfs on these pools can take hours while iterating through snapshots over and over again, whereas it could take minutes instead if changelist_gather simply ignored them to begin with.

Actions #1

Updated by Rich Lowe 4 months ago

  • Project changed from site to illumos gate
  • Category set to zfs - Zettabyte File System
Actions

Also available in: Atom PDF