Bug 31850

Summary: panic: allocdirect_check
Product: Base System Reporter: Igor Zabelin <igorz>
Component: i386Assignee: Kirk McKusick <mckusick>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-STABLE   
Hardware: Any   
OS: Any   

Description Igor Zabelin 2001-11-08 08:30:01 UTC
When soft updates enabled on /usr every 4-5 days system panic:

panic: allocdirect_check: old 6980888 != new 6980888 || lbn 9 >= 12
mp_lock = 00000001; cpuid = 0; lapic.id = 03000000
boot() called on cpu#0

panic: allocdirect_check: old 3012416 != new 3012416 || lbn 9 >= 12
mp_lock = 01000001; cpuid = 1; lapic.id = 00000000
boot() called on cpu#1
Comment 1 silby freebsd_committer freebsd_triage 2002-02-26 07:40:39 UTC
Responsible Changed
From-To: freebsd-bugs->mckusick

This is a soft updates error, over to McKusick
Comment 2 Kirk McKusick freebsd_committer freebsd_triage 2002-03-13 21:27:28 UTC
State Changed
From-To: open->closed

This was a bug in /sys/ufs/ffs/ffs_inode.c. It was fixed in -current: 

---------------------------- 
revision 1.73 
date: 2001/12/13 05:07:48;  author: mckusick;  state: Exp;  lines: +13 -1 
When a file is partially truncated, we first check to see if the 
new file end will land in the middle of a file hole. Since the last 
block of a file must always be allocated, the hole is filled by 
allocating a block at that location. If the hole being filled is 
a direct block, then the truncation may eventually reduce the 
full sized block down to a fragment. When running with soft 
updates, it is necessary to FSYNC the file after allocating the 
block and before creating the fragment to avoid triggering a 
soft updates inconsistency when the block unexpectedly shrinks. 

Found by:       Matthew Dillon <dillon@apollo.backplane.com> 
MFC after:      1 week 
---------------------------- 

It was MFC'ed one week later: 

---------------------------- 
revision 1.56.2.4 
date: 2001/12/20 21:10:52;  author: dillon;  state: Exp;  lines: +13 -0 
MFC 1.73 - fix softupdates panic easily produced on NFS server by NFS client. 
(Jordan's 'Make your FreeBSD box fall over' bug). 

Approved by:    Release Engineers 
---------------------------- 

Note that the above MFC happened after the release of 4.5, 
so users must have updated to -stable after 2001/12/20 to 
have this fix.