[Bug 106107] UFS: fsck_ffs: left-over fsck_snapshot after unfinished background fsck if filesystem clean
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Oct 2023 22:39:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=106107
--- Comment #15 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:
URL:
https://cgit.FreeBSD.org/src/commit/?id=d3a36e4b7459b2d62c4cd50de7a8e3195d7241c7
commit d3a36e4b7459b2d62c4cd50de7a8e3195d7241c7
Author: Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2023-10-25 22:36:45 +0000
Commit: Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2023-10-25 22:38:11 +0000
Delete snapshot after opening it when running fsck_ffs(9) in background.
When fsck_ffs(8) runs in background, it creates a snapshot named
fsck_snapshot in the filesystem's .snap directory. The fsck_snapshot
file was removed when the background fsck finished. If the system
crashed or the fsck exited unexpectedly, the fsck_snapshot file
would remain. The snapshot would consume ever more space as the
filesystem changed over time until it was removed by a system
administrator or a future run of background fsck removed it to
create a new snapshot file.
This commit unlinks the .snap/fsck_snapshot file immediately after
opening it so that it will be reclaimed when fsck closes it at the
conclusion of its run. After a system crash, it will be removed as
part of the filesystem cleanup because of its zero reference count.
As only a few milliseconds pass between its creation and unlinking,
there is far less opportunity for it to be accidentally left behind.
PR: 106107
MFC-after: 1 week
sbin/fsck_ffs/fsck.h | 1 -
sbin/fsck_ffs/fsutil.c | 1 -
sbin/fsck_ffs/globs.c | 2 --
sbin/fsck_ffs/main.c | 8 +++++---
sbin/fsck_ffs/setup.c | 8 ++++----
5 files changed, 9 insertions(+), 11 deletions(-)
--
You are receiving this mail because:
You are the assignee for the bug.