From owner-freebsd-questions@FreeBSD.ORG Tue Dec 8 11:34:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52C9106566B for ; Tue, 8 Dec 2009 11:34:16 +0000 (UTC) (envelope-from kheuer2@gwdg.de) Received: from tmailer.gwdg.de (tmailer.gwdg.de [134.76.10.23]) by mx1.freebsd.org (Postfix) with ESMTP id 58AF08FC1C for ; Tue, 8 Dec 2009 11:34:16 +0000 (UTC) Received: from gwdu60.gwdg.de ([134.76.8.60]) by mailer.gwdg.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NHxgq-00074G-9Q; Tue, 08 Dec 2009 11:53:08 +0100 Date: Tue, 8 Dec 2009 11:53:07 +0100 (CET) From: Konrad Heuer To: cronfy In-Reply-To: <4B1E2D40.9060900@sprinthost.ru> Message-ID: <20091208114509.B67127@gwdu60.gwdg.de> References: <4B1DF953.4050504@sprinthost.ru> <4B1E2D40.9060900@sprinthost.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Level: - X-Virus-Scanned: (clean) by exiscan+sophie Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD is too filesystem errors sensitive X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 11:34:16 -0000 On Tue, 8 Dec 2009, cronfy wrote: > >>> Please forgive me for probably a very stupid question. But why is FreeBSD >>> so sensitive to filesystem errors that it ends up with panics like >>> 'freeing free block' or 'ffs_valloc: dup alloc'? I just can't get it. >>> Failed to allocate vnode? Go allocate another one! Freeing free block? >>> Leave it free then! I understand these situations should never happen, but >>> the hell why is it required to panic and kill everything that would be >>> working happily even if something very disasterous happen to /backup >>> partition, in example? >> Probably because UFS is not designed to be a backup file system but a >> working one :) >> >> All those errors indicate file system corruption. To protect other data >> from getting corrupted (e.g. by invalid pointers or calculations), the >> kernel panics. > > To protect us against terrorists our government do strange things too ;-) > > After panic data *is* getting corrupted anyway - MySQL tables that were open > are broken, soft-updates are unsync'ed etc etc. > Server is required to reboot, fsck, time is wasted while this occurs. Why all > this should happen because of a single vnode fail? Why not just throw message > in /var/log/messages, return "oh, I failed to save a file" to the process > that initiated the operation and just go on? Are consequences of attept to > "free already free block" *so* dangerous that it is needed to give up on > EVERYTHING? Let's say it was not /backup partition, ok, it was > /var/tmp/some-php-session or even /var/cron/tabs/someuser file that failed. > So what? Even /boot/kernel/kernel corruption is not critical if you are not > going to reboot right now (or if you have /boot/kernel.old :) > > Is there a way to say "Dear kernel, don't panic, I'am holding your hand, keep > working please-please-please?" If so, can it lead to complete filesystem > corruption indeed or it is not so serious? Afaik you can't do this. And you shouldn't do if it'd be possible. The file system errors you mention above should not happen under any normal circumstances. They may happen after a crash caused by other reasons but should get repaired by fsck. The kernel cannot continue with such errors because the whole file system metadata cannot be trusted anymore until repaired. I use FreeBSD with UFS for more than 15 years now; partially on heavily loaded and i/o-bound systems. I never had any serious filesystem problems as long as the disks or the storage area network (san) didn't fail. In the worst case, after a san crash, I had to run fsck three times (one run immediately after the other) in single user mode on large partitions until all errors were repaired. Best regards Konrad Heuer GWDG, Am Fassberg, 37077 Goettingen, Germany, kheuer2@gwdg.de