diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2021-04-02 18:57:34 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2021-04-02 18:58:49 +0000 |
commit | fc56fd262d0bc8ee523f6c8e6a65c0ff5417af6e (patch) | |
tree | 365076129df6de03b9d6cf3017628d0f5e072fe4 /sbin/fsck_ffs/globs.c | |
parent | a04906f0273fa6d80eb3ebf22b9b84e53e6b21e0 (diff) | |
download | src-fc56fd262d0bc8ee523f6c8e6a65c0ff5417af6e.tar.gz src-fc56fd262d0bc8ee523f6c8e6a65c0ff5417af6e.zip |
Ensure that all allocated data structures in fsck_ffs are freed.
Several large data structures are allocated by fsck_ffs to track
resource usage. Most but not all were deallocated at the end of
checking each filesystem. This commit consolidates the freeing
of all data structures in one place and adds one that had previously
been missing.
It is important to clean up these data structures as they can be
large. If the previous allocations have not been freed, fsck_ffs
can run out of address space when many large filesystems are being
checked. An alternative would be to fork a new instance of fsck_ffs
for each filesystem to be checked, but we choose to free the small
set of large structures to save the fork overhead.
Reported by: Chuck Silvers
Tested by: Chuck Silvers
MFC after: 7 days
Sponsored by: Netflix
Diffstat (limited to 'sbin/fsck_ffs/globs.c')
-rw-r--r-- | sbin/fsck_ffs/globs.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index 45d6b80d8fe8..be4434ce38ca 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -128,7 +128,6 @@ fsckinit(void) bzero(totalreadtime, sizeof(struct timespec) * BT_NUMBUFTYPES); bzero(&startprog, sizeof(struct timespec)); bzero(&sblk, sizeof(struct bufarea)); - pdirbp = NULL; cursnapshot = 0; listmax = numdirs = dirhash = inplast = 0; countdirs = 0; @@ -159,7 +158,6 @@ fsckinit(void) fsreadfd = 0; fswritefd = 0; maxfsblock = 0; - blockmap = NULL; maxino = 0; lfdir = 0; lfname = "lost+found"; |