From 72f854ce8f359100d957a07da44ae98591d3dfd9 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 17 Jan 2018 17:58:24 +0000 Subject: Correct fsck journal-recovery code to update a cylinder-group check-hash after making changes to the cylinder group. The problem was that the journal-recovery code was calling the libufs bwrite() function instead of the cgput() function. The cgput() function updates the cylinder-group check-hash before writing the cylinder group. This change required the additions of the cgget() and cgput() functions to the libufs API to avoid a gratuitous bcopy of every cylinder group to be read or written. These new functions have been added to the libufs manual pages. This was the first opportunity that I have had to use and document the use of the EDOOFUS error code. Reviewed by: kib Reported by: emaste and others --- lib/libufs/libufs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libufs/libufs.h') diff --git a/lib/libufs/libufs.h b/lib/libufs/libufs.h index 7201d00b2715..400704596148 100644 --- a/lib/libufs/libufs.h +++ b/lib/libufs/libufs.h @@ -111,6 +111,8 @@ int berase(struct uufsd *, ufs2_daddr_t, ufs2_daddr_t); ufs2_daddr_t cgballoc(struct uufsd *); int cgbfree(struct uufsd *, ufs2_daddr_t, long); ino_t cgialloc(struct uufsd *); +int cgget(struct uufsd *, int, struct cg *); +int cgput(struct uufsd *, struct cg *); int cgread(struct uufsd *); int cgread1(struct uufsd *, int); int cgwrite(struct uufsd *); -- cgit v1.2.3