HomeFreeBSD

ZTS: close in mmapwrite.c

Description

ZTS: close in mmapwrite.c

commit a7304ab9c1ea62c556aa7d007821322afc75ff79 upstream

mmapwrite is used during the ZTS to identify issues with mmap-ed files.
This helper program exercises this pathway by continuously writing to a
file. ee6bf97c7 modified the writing threads to terminate after a set
amount of total data is written. This change allows standard program
execution to reach the end of a writer thread without closing the file
descriptor, introducing a resource "leak."

This patch appeases resource leak analyses by close()-ing the file at
the end of the thread.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Closes #14353

Details

Provenance
Antonio Russo <aerusso@aerusso.net>Authored on Jan 6 2023, 6:52 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 10 2023, 1:15 AM
Parents
rGa75af541cf18: ZTS: limit mmapwrite file size
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG5371d8dae785: ZTS: close in mmapwrite.c (authored by Antonio Russo <aerusso@aerusso.net>).Jan 10 2023, 1:15 AM