Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs ffs: apply the remaining ffs_snapshot.c part of ...



details:   https://anonhg.NetBSD.org/src/rev/e133295ca483
branches:  trunk
changeset: 374774:e133295ca483
user:      chs <chs%NetBSD.org@localhost>
date:      Thu May 11 23:11:25 2023 +0000

description:
ffs: apply the remaining ffs_snapshot.c part of this FreeBSD commit:

  commit 364ed814e7285c8216d8a201d3ab3674eb34ce29
  Author: Kirk McKusick <mckusick%FreeBSD.org@localhost>
  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 <henry%jot.to@localhost>
    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

diffstat:

 sys/ufs/ffs/ffs_snapshot.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c7858d0719e5 -r e133295ca483 sys/ufs/ffs/ffs_snapshot.c
--- a/sys/ufs/ffs/ffs_snapshot.c        Thu May 11 21:36:31 2023 +0000
+++ b/sys/ufs/ffs/ffs_snapshot.c        Thu May 11 23:11:25 2023 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index