lzc_snapshot does not fill in errlist on ENOENT
DLPX-40482 lzc_snapshot does not fill in errlist on ENOENT
Updated by Matthew Ahrens over 3 years ago
lzc_snapshot() takes a list of snapshot to create. If the list contains both datasets that exist and datasets that do not exist, the expected behavior is that the returned error map will contain an errno for each dataset that is missing (or at least the first one). Instead the error map is empty, so we have no indication as to what datasets were problematic.
The problem is that zfs_secpolicy_snapshot() is causing the ioctl to bail early, when it can't find the dataset in order to determine if it is assigned to a zone.
Fix is to not call secpolicy funcs if the process is root in the global zone. This will also improve performance (marginally). This is a bit of a hack, but it is easy and correct.
Updated by Electric Monk about 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 25f7d993adbfb3452ac4625b3791670746d35ae3 Author: Matthew Ahrens <firstname.lastname@example.org> Date: 2016-07-14T19:08:46.000Z 7071 lzc_snapshot does not fill in errlist on ENOENT Reviewed by: Igor Kozhukhov <email@example.com> Reviewed by: George Wilson <firstname.lastname@example.org> Reviewed by: Dan Kimmel <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>