zfs/include/os/freebsd/spl/sys
Matthew Ahrens 1f043c8be1
Fix zfs send progress reporting
The progress of a send is supposed to be reported by `zfs send -v`, but
it is not.  This works by creating a new user thread (with
pthread_create()) which does ZFS_IOC_SEND_PROGRESS ioctls to check how
much progress has been made.  This IOCTL finds the specified send (since
there may be multiple concurrent sends in the system).  The IOCTL also
checks that the specified send was started by the current process.

On Linux, different threads of the same process are represented as
different `struct task_struct`s (and, confusingly, have different
PID's).  To check if if two threads are in the same process, we need to
check if they have the same `struct task_struct:group_leader`.

We used to to this correctly, but it was inadvertently changed by
30af21b025 (Redacted Send) to simply check if the current
`struct task_struct` is the one that started the send.

This commit changes the code back to checking if the send was started by
a `struct task_struct` with the same `group_leader` as the calling
thread.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Chris Wedgwood <cw@f00f.org>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #10215 
Closes #10216
2020-04-20 10:12:48 -07:00
..
Makefile.am Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
acl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
acl_impl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
atomic.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
byteorder.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
callb.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
ccompile.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
cmn_err.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
condvar.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
console.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
cred.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
ctype.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
debug.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
dirent.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
disp.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
dkio.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
endian.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
extdirent.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
file.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
freebsd_rwlock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
inttypes.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
isa_defs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kmem.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kmem_cache.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kstat.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
list.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
list_impl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
lock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
misc.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mod_os.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mode.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mount.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
mutex.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
param.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
policy.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
proc.h Fix zfs send progress reporting 2020-04-20 10:12:48 -07:00
processor.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
procfs_list.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
random.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
rwlock.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sdt.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sid.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sig.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
simd.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
simd_x86.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
spl_condvar.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
string.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
strings.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sunddi.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sysmacros.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
systeminfo.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
systm.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
taskq.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
thread.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
time.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
timer.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
trace.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
trace_zfs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
types.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
types32.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
uio.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
uuid.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vfs.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vm.h Use new FreeBSD API to largely eliminate object locking 2020-04-17 09:30:26 -07:00
vmsystm.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vnode.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
vnode_impl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
zmod.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
zone.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00