aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2009-03-09 19:35:20 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2009-03-09 19:35:20 +0000
commit5bd65606f4466e6023888b87387211adb460edc8 (patch)
treefa5afa97f873f392e028df96bcfc150033e0a387 /sys/ufs
parentf3106cde19bf908b238b25756217f93245deac95 (diff)
downloadsrc-5bd65606f4466e6023888b87387211adb460edc8.tar.gz
src-5bd65606f4466e6023888b87387211adb460edc8.zip
Adjust some variables (mostly related to the buffer cache) that hold
address space sizes to be longs instead of ints. Specifically, the follow values are now longs: runningbufspace, bufspace, maxbufspace, bufmallocspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace, hirunningspace, maxswzone, maxbcache, and maxpipekva. Previously, a relatively small number (~ 44000) of buffers set in kern.nbuf would result in integer overflows resulting either in hangs or bogus values of hidirtybuffers and lodirtybuffers. Now one has to overflow a long to see such problems. There was a check for a nbuf setting that would cause overflows in the auto-tuning of nbuf. I've changed it to always check and cap nbuf but warn if a user-supplied tunable would cause overflow. Note that this changes the ABI of several sysctls that are used by things like top(1), etc., so any MFC would probably require a some gross shims to allow for that. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=189595
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index dff56edeb783..b45532e50f84 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -2229,7 +2229,7 @@ ffs_copyonwrite(devvp, bp)
VI_UNLOCK(devvp);
if (saved_runningbufspace != 0) {
bp->b_runningbufspace = saved_runningbufspace;
- atomic_add_int(&runningbufspace,
+ atomic_add_long(&runningbufspace,
bp->b_runningbufspace);
}
return (0); /* Snapshot gone */
@@ -2354,7 +2354,7 @@ ffs_copyonwrite(devvp, bp)
*/
if (saved_runningbufspace != 0) {
bp->b_runningbufspace = saved_runningbufspace;
- atomic_add_int(&runningbufspace, bp->b_runningbufspace);
+ atomic_add_long(&runningbufspace, bp->b_runningbufspace);
}
return (error);
}
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 3e0760fffa1b..3913d7959850 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1915,7 +1915,7 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp)
}
}
bp->b_runningbufspace = bp->b_bufsize;
- atomic_add_int(&runningbufspace,
+ atomic_add_long(&runningbufspace,
bp->b_runningbufspace);
} else {
error = ffs_copyonwrite(vp, bp);