Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix zfs send progress reporting #10216

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/os/freebsd/spl/sys/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,11 @@ do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,

int uread(proc_t *, void *, size_t, uintptr_t);
int uwrite(proc_t *, void *, size_t, uintptr_t);

static inline boolean_t
zfs_proc_is_caller(proc_t *p)
{
return (p == curproc);
}

#endif /* _OPENSOLARIS_SYS_PROC_H_ */
7 changes: 7 additions & 0 deletions include/os/linux/spl/sys/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@
#define _SPL_PROC_H

#include <linux/proc_fs.h>
#include <linux/sched.h>

extern struct proc_dir_entry *proc_spl_kstat;

int spl_proc_init(void);
void spl_proc_fini(void);

static inline boolean_t
zfs_proc_is_caller(struct task_struct *t)
{
return (t->group_leader == current->group_leader);
}

#endif /* SPL_PROC_H */
2 changes: 1 addition & 1 deletion module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5468,7 +5468,7 @@ zfs_ioc_send_progress(zfs_cmd_t *zc)
for (dsp = list_head(&ds->ds_sendstreams); dsp != NULL;
dsp = list_next(&ds->ds_sendstreams, dsp)) {
if (dsp->dss_outfd == zc->zc_cookie &&
dsp->dss_proc == curproc)
zfs_proc_is_caller(dsp->dss_proc))
break;
}

Expand Down