freebsd-nq/cmd/zed
наб c9c6537731 zed: only go up to current limit in close_from() fallback
Consider the following strace log:
  prlimit64(0, RLIMIT_NOFILE,
            NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
  dup2(0, 30)                         = 30
  dup2(0, 300)                        = 300
  dup2(0, 3000)                       = -1 EBADF (Bad file descriptor)
  dup2(0, 30000)                      = -1 EBADF (Bad file descriptor)
  dup2(0, 300000)                     = -1 EBADF (Bad file descriptor)
  prlimit64(0, RLIMIT_NOFILE,
            {rlim_cur=1024*1024, rlim_max=1024*1024}, NULL) = 0
  dup2(0, 30)                         = 30
  dup2(0, 300)                        = 300
  dup2(0, 3000)                       = 3000
  dup2(0, 30000)                      = 30000
  dup2(0, 300000)                     = 300000

Even a privileged process needs to bump its rlimit before being able
to use fds higher than rlim_cur.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11834
2021-04-07 14:52:51 -07:00
..
agents zed: set names for all threads 2021-04-02 16:29:35 -07:00
zed.d ZED/zfs-list-cacher.sh: don't exit on ignored event type 2020-12-18 09:34:10 -08:00
.gitignore
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
zed_conf.c zed: replace zed_file_write_n() with write(2), purge it 2021-04-07 14:52:30 -07:00
zed_conf.h zed: purge all mentions of a configuration file 2021-04-07 14:50:52 -07:00
zed_disk_event.c zed: set names for all threads 2021-04-02 16:29:35 -07:00
zed_disk_event.h
zed_event.c zed: merge all _NOT_IMPLEMENTED_ events 2021-04-07 14:51:34 -07:00
zed_event.h Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
zed_exec.c zed: print combined system/user time after ZEDLET death 2021-04-07 14:50:03 -07:00
zed_exec.h zed: allow limiting concurrent jobs 2021-04-02 16:30:53 -07:00
zed_file.c zed: only go up to current limit in close_from() fallback 2021-04-07 14:52:51 -07:00
zed_file.h zed: replace zed_file_write_n() with write(2), purge it 2021-04-07 14:52:30 -07:00
zed_log.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
zed_log.h Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
zed_strings.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
zed_strings.h Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
zed.c zed: purge all mentions of a configuration file 2021-04-07 14:50:52 -07:00
zed.h zed: purge all mentions of a configuration file 2021-04-07 14:50:52 -07:00