Module Name: src
Committed By: chs
Date: Thu May 11 23:11:25 UTC 2023
Modified Files:
src/sys/ufs/ffs: ffs_snapshot.c
Log Message:
ffs: apply the remaining ffs_snapshot.c part of this FreeBSD commit:
commit 364ed814e7285c8216d8a201d3ab3674eb34ce29
Author: Kirk McKusick <[email protected]>
Date: Thu Dec 9 21:24:00 2004 +0000
Fixes a bug that caused UFS2 filesystems bigger than 2TB to
prematurely report that they were full and/or to panic the kernel
with the message ``ffs_clusteralloc: allocated out of group''.
Submitted by: Henry Whincup <[email protected]>
MFC after: 1 week
all the other changes in that commit were applied previously by others:
- sborrill commmitted ffs_alloc.c rev 1.123 in 2009
- simonb committed ffs_alloc.c rev 1.110 in 2008
- the ffs_clusteralloc() part is not needed because we no longer have
that function.
fixes PR 57307
To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/ufs/ffs/ffs_snapshot.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.154 src/sys/ufs/ffs/ffs_snapshot.c:1.155
--- src/sys/ufs/ffs/ffs_snapshot.c:1.154 Sat Apr 16 07:59:46 2022
+++ src/sys/ufs/ffs/ffs_snapshot.c Thu May 11 23:11:25 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_snapshot.c,v 1.154 2022/04/16 07:59:46 hannken Exp $ */
+/* $NetBSD: ffs_snapshot.c,v 1.155 2023/05/11 23:11:25 chs Exp $ */
/*
* Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.154 2022/04/16 07:59:46 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.155 2023/05/11 23:11:25 chs Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -990,7 +990,7 @@ cgaccount1(int cg, struct vnode *vp, voi
fs->fs_bsize - fs->fs_cgsize);
numblks = howmany(fs->fs_size, fs->fs_frag);
len = howmany(fs->fs_fpg, fs->fs_frag);
- base = cg * fs->fs_fpg / fs->fs_frag;
+ base = cgbase(fs, cg) / fs->fs_frag;
if (base + len >= numblks)
len = numblks - base - 1;
loc = 0;