Source-Changes-HG archive

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

[src/netbsd-3-0]: src/sys Pull up following revision(s) (requested by hannken...



details:   https://anonhg.NetBSD.org/src/rev/979a636ce147
branches:  netbsd-3-0
changeset: 579426:979a636ce147
user:      ghen <ghen%NetBSD.org@localhost>
date:      Thu Jun 28 11:43:21 2007 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #1807):
        sys/ufs/ufs/ufs_quota.c: revision 1.46
        sys/ufs/ufs/quota.h: revision 1.24
        sys/sys/param.h: patch
If a quota-enabled file system has 65536 active vnodes for one uid
the reference counter of the corresponding struct dquot will overflow.
Change the type of the reference counter from u_int16_t to u_int32_t and
add an assertion to check for overflow.
Bump kernel version as LKM's depending on UFS internals will have to be
recompiled after this change (discussed and approved on tech-kern).

diffstat:

 sys/sys/param.h         |  4 ++--
 sys/ufs/ufs/quota.h     |  5 ++---
 sys/ufs/ufs/ufs_quota.c |  5 +++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diffs (64 lines):

diff -r 9d983f2e41d4 -r 979a636ce147 sys/sys/param.h
--- a/sys/sys/param.h   Tue Jun 26 15:05:37 2007 +0000
+++ b/sys/sys/param.h   Thu Jun 28 11:43:21 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.h,v 1.211.2.8.2.5 2006/10/28 13:57:41 ghen Exp $ */
+/*     $NetBSD: param.h,v 1.211.2.8.2.6 2007/06/28 11:43:22 ghen Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *     2.99.9          (299000900)
  */
 
-#define        __NetBSD_Version__      300002000       /* NetBSD 3.0.2_PATCH */
+#define        __NetBSD_Version__      300002001       /* NetBSD 3.0.2_PATCH */
 
 #define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
     (m) * 1000000) + (p) * 100) >= __NetBSD_Version__)
diff -r 9d983f2e41d4 -r 979a636ce147 sys/ufs/ufs/quota.h
--- a/sys/ufs/ufs/quota.h       Tue Jun 26 15:05:37 2007 +0000
+++ b/sys/ufs/ufs/quota.h       Thu Jun 28 11:43:21 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quota.h,v 1.18 2004/04/27 17:37:31 jrf Exp $   */
+/*     $NetBSD: quota.h,v 1.18.14.1 2007/06/28 11:43:21 ghen Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -118,9 +118,8 @@
        LIST_ENTRY(dquot) dq_hash;      /* hash list */
        TAILQ_ENTRY(dquot) dq_freelist; /* free list */
        u_int16_t dq_flags;             /* flags, see below */
-       u_int16_t dq_cnt;               /* count of active references */
-       u_int16_t dq_spare;             /* unused spare padding */
        u_int16_t dq_type;              /* quota type of this dquot */
+       u_int32_t dq_cnt;               /* count of active references */
        u_int32_t dq_id;                /* identifier this applies to */
        struct  ufsmount *dq_ump;       /* filesystem that this is taken from */
        struct  dqblk dq_dqb;           /* actual usage & quotas */
diff -r 9d983f2e41d4 -r 979a636ce147 sys/ufs/ufs/ufs_quota.c
--- a/sys/ufs/ufs/ufs_quota.c   Tue Jun 26 15:05:37 2007 +0000
+++ b/sys/ufs/ufs/ufs_quota.c   Thu Jun 28 11:43:21 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_quota.c,v 1.33 2005/02/26 22:32:20 perry Exp $     */
+/*     $NetBSD: ufs_quota.c,v 1.33.4.1 2007/06/28 11:43:21 ghen Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.33 2005/02/26 22:32:20 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.33.4.1 2007/06/28 11:43:21 ghen Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -851,6 +851,7 @@
 {
 
        dq->dq_cnt++;
+       KASSERT(dq->dq_cnt > 0);
 }
 
 /*



Home | Main Index | Thread Index | Old Index