Page MenuHomeFreeBSD

zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget
ClosedPublic

Authored by avg on Apr 28 2015, 6:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 29, 8:24 AM
Unknown Object (File)
Wed, Apr 29, 8:17 AM
Unknown Object (File)
Tue, Apr 28, 8:34 PM
Unknown Object (File)
Tue, Apr 28, 8:29 PM
Unknown Object (File)
Tue, Apr 28, 9:38 AM
Unknown Object (File)
Sun, Apr 26, 2:00 AM
Unknown Object (File)
Apr 21 2026, 1:52 PM
Unknown Object (File)
Apr 12 2026, 10:32 AM
Subscribers

Details

Summary

This allows to ensure that we do not write a file that was opened
for reading only or vice versa.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg retitled this revision from to zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: delphij, smh, pjd.
delphij edited edge metadata.

Looks good to me.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
5438 ↗(On Diff #5046)

I think you would want to upstream a change that modifies this to fp = getf(fd); so we don't diverge here.

This revision is now accepted and ready to land.Apr 28 2015, 8:15 AM
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
5438 ↗(On Diff #5046)

That makes sense and I would love to do it, but given how hard (for me) is to submit an upstream change it might take me a while.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
5423 ↗(On Diff #5046)

Please also note that the current code has a bug here: we need CAP_WRITE not CAP_READ.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
5438 ↗(On Diff #5046)

As matt is on the team here and illumos advocate now is this something he can assist with. I myself has also found that process very time consuming.

This revision was automatically updated to reflect the committed changes.
This comment was removed by avg.