Enable PF_FSTRANS for ioctl secpolicy callbacks (#4571)

At the very least, the zfs_secpolicy_write_perms ioctl security policy
callback, which calls dsl_dataset_hold(), can require freeing memory and,
therefore, re-enter ZFS.  This patch enables PF_FSTRANS for all of the
security policy callbacks similarly to the manner in which it's enabled
for the actual ioctl callback.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4554
This commit is contained in:
Tim Chase 2016-05-02 12:00:50 -05:00 committed by Brian Behlendorf
parent ef1c27117b
commit ddab862d4c
1 changed files with 4 additions and 1 deletions

View File

@ -5829,8 +5829,11 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
}
if (error == 0 && !(flag & FKIOCTL))
if (error == 0 && !(flag & FKIOCTL)) {
cookie = spl_fstrans_mark();
error = vec->zvec_secpolicy(zc, innvl, CRED());
spl_fstrans_unmark(cookie);
}
if (error != 0)
goto out;