]> git.proxmox.com Git - mirror_zfs.git/commitdiff
zed: reap child after killing on time-out
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Fri, 26 Mar 2021 21:21:00 +0000 (22:21 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Mar 2021 21:21:00 +0000 (14:21 -0700)
When a child process is killed waitpid() must be called on the
pid the reap the zombie process.

Update BUGS section to reflect reality by replacing "zedlets
aren't time limited with "zedlets can be interrupted".

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11769
Closes #11798

cmd/zed/zed_exec.c
man/man8/zed.8.in

index aae607a9b7de3e8b3d6d4049aa523b6bbaf1cada..e8f5102138688ad205fc3cb0e6ded287f0badd3e 100644 (file)
@@ -173,6 +173,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
                zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d",
                    prog, pid);
                (void) kill(pid, SIGKILL);
+               (void) waitpid(pid, &status, 0);
        }
 }
 
index 3d36c33ac9ca5005d1ebc0858b1b5699d89233e5..e32a89de8a0f34bc83d9bc370e6b35f8fcb8bbbd 100644 (file)
@@ -234,8 +234,8 @@ Terminate the daemon.
 Events are processed synchronously by a single thread.  This can delay the
 processing of simultaneous zevents.
 .PP
-There is no maximum timeout for ZEDLET execution.  Consequently, a misbehaving
-ZEDLET can delay the processing of subsequent zevents.
+ZEDLETs are killed after a maximum of ten seconds.
+This can lead to a violation of a ZEDLET's atomicity assumptions.
 .PP
 The ownership and permissions of the \fIenabled-zedlets\fR directory (along
 with all parent directories) are not checked.  If any of these directories