K 10 svn:author V 3 avg K 8 svn:date V 27 2015-04-28T09:11:47.457744Z K 7 svn:log V 836 zfs_onexit_fd_hold: return EBADF even if devfs_get_cdevpriv gave ENOENT /dev/zfs always has per-open data, so when it is missing the file descriptor is for some other file. Returning ENOENT in this case is confusing as a variety of other conditions (like a missing dataset) may result in the same error. It's better to consistently return EBADF for any problems with the file descriptor. Note that zfs_onexit_fd_hold() is used with 'automatic cleanup fd' - when that fd is closed, typically because a process is terminated, some cleanup action is taken by ZFS driver. E.g. a temporary snapshot hold is released. Perhaps, it would even be worthwhile changing devfs_get_cdevpriv() to return EBADF if there is no associated data. Differential Revision: https://reviews.freebsd.org/D2370 Reviewed by: delphij, smh MFC after: 12 days END