freebsd-skq/sys/cddl
Andriy Gapon 1af760ce1b 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
2015-04-28 09:11:47 +00:00
..
boot/zfs MFV r274273: 2014-11-10 08:20:21 +00:00
compat/opensolaris Add the arm64 defines for cddl code. 2015-04-01 08:31:56 +00:00
contrib/opensolaris zfs_onexit_fd_hold: return EBADF even if devfs_get_cdevpriv gave ENOENT 2015-04-28 09:11:47 +00:00
dev Adjust PROF_ARTIFICIAL_FRAMES in the DTrace profile provider on ARM to 2015-04-25 15:43:12 +00:00