NetBSD Problem Report #35704
From www@NetBSD.org Mon Feb 19 11:00:50 2007
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
id B4AB263B9FB; Mon, 19 Feb 2007 11:00:50 +0000 (UTC)
Message-Id: <20070219110050.B4AB263B9FB@narn.NetBSD.org>
Date: Mon, 19 Feb 2007 11:00:50 +0000 (UTC)
From: p.jordan@teles.de
Reply-To: p.jordan@teles.de
To: gnats-bugs@NetBSD.org
Subject: problems in a full ffs file system
X-Send-Pr-Version: www-1.0
>Number: 35704
>Category: kern
>Synopsis: problems in a full ffs file system
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 19 11:05:00 +0000 2007
>Closed-Date: Tue Jun 29 15:49:47 +0000 2010
>Last-Modified: Tue Jun 29 15:49:47 +0000 2010
>Originator: Peter
>Release: NetBSD 3.0
>Organization:
>Environment:
System: NetBSD performance_c1 3.0 NetBSD 3.0 (MYKERNEL) #1: Fri Feb 16 14:00:57 2007 admin@NETBSD:/usr/NetBSD-3.0/cross/i386/obj/sys/arch/i386/compile/MYKERNEL
i386
>Description:
Hello,
we have a Problem in NetBSD 3.0 and ffs filesystem.
If we fill as a root user a ffs file system until no space is available,
we get corrupted files.
/home: write failed, file system is full
mount:
/dev/wd0g 970M 970M -48M 105% /home
After that, the root user is able to create files like:
echo 'aaaaaaaaa' > ffs_test
this file (ffs_test) is ok.
After making this file bigger with:
cat ffs_test >> ffs_test
this file (ffs_test) is corrupt.
This error occurs if we mounted this filesystem in softdep-mode and
default-mode. With mounting this filesystem in synchronous mode,
this error DOES NOT occure. Also by filling the filesystem as a non
root user, who is not able to write more then 100 %,
the error DOES NOT occure.
On other systems we get even coredumps after panic
and some other problems occured (e.g. binaries did not start anymore).
>How-To-Repeat:
* login as root user
* make your filesystem full until:
/home: write failed, file system is full
* create a new file:
echo 'aaaaaaaaa' > ffs_test
* make this file bigger with:
cat ffs_test >> ffs_test
>Fix:
>Release-Note:
>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/35704: problems in a full ffs file system
Date: Tue, 2 Feb 2010 23:01:52 +0100
On Mon, Feb 19, 2007 at 11:05:01AM +0000, p.jordan@teles.de wrote:
> >How-To-Repeat:
> * login as root user
> * make your filesystem full until:
> /home: write failed, file system is full
> * create a new file:
> echo 'aaaaaaaaa' > ffs_test
> * make this file bigger with:
> cat ffs_test >> ffs_test
Still reproductible on netbsd-5.
The patch proposed in
http://mail-index.netbsd.org/tech-kern/2010/02/02/msg007156.html
fixes it for me ...
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/35704 CVS commit: src/sys/ufs
Date: Sun, 7 Feb 2010 17:12:40 +0000
Module Name: src
Committed By: bouyer
Date: Sun Feb 7 17:12:40 UTC 2010
Modified Files:
src/sys/ufs/ext2fs: ext2fs_inode.c
src/sys/ufs/ffs: ffs_inode.c
src/sys/ufs/lfs: lfs_inode.c
src/sys/ufs/ufs: ufs_inode.c
Log Message:
- ufs_balloc_range(): on error, only PG_RELEASED the pages that were
allocated to extend the file to the new size. Releasing all pages
may release pages that contains previously-written data not yet flushed
to disk. Should fix PR kern/35704
- {ffs,lfs,ext2fs}_truncate(): Even if the inode's size is the same as
the new length, call uvm_vnp_setsize(). *_truncate() may have been
called by *_write() in the error path (e.g. block allocation failure
because of quota of file system full), and at this point v_writesize
has been set to the desired size of the file and not reverted to the
old size. Not adjusting v_writesize to the real size cause
genfs_do_io() to write to disk past the real end of the file.
To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/ufs/ext2fs/ext2fs_inode.c
cvs rdiff -u -r1.103 -r1.104 src/sys/ufs/ffs/ffs_inode.c
cvs rdiff -u -r1.120 -r1.121 src/sys/ufs/lfs/lfs_inode.c
cvs rdiff -u -r1.78 -r1.79 src/sys/ufs/ufs/ufs_inode.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/35704 CVS commit: [netbsd-5] src/sys/ufs
Date: Mon, 22 Feb 2010 04:43:47 +0000
Module Name: src
Committed By: snj
Date: Mon Feb 22 04:43:47 UTC 2010
Modified Files:
src/sys/ufs/ext2fs [netbsd-5]: ext2fs_inode.c
src/sys/ufs/ffs [netbsd-5]: ffs_inode.c
src/sys/ufs/lfs [netbsd-5]: lfs_inode.c
src/sys/ufs/ufs [netbsd-5]: ufs_inode.c
Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1302):
sys/ufs/ext2fs/ext2fs_inode.c: revision 1.71
sys/ufs/ffs/ffs_inode.c: revision 1.104
sys/ufs/lfs/lfs_inode.c: revision 1.121
sys/ufs/ufs/ufs_inode.c: revision 1.79
- ufs_balloc_range(): on error, only PG_RELEASED the pages that were
allocated to extend the file to the new size. Releasing all pages
may release pages that contains previously-written data not yet flushed
to disk. Should fix PR kern/35704
- {ffs,lfs,ext2fs}_truncate(): Even if the inode's size is the same as
the new length, call uvm_vnp_setsize(). *_truncate() may have been
called by *_write() in the error path (e.g. block allocation failure
because of quota of file system full), and at this point v_writesize
has been set to the desired size of the file and not reverted to the
old size. Not adjusting v_writesize to the real size cause
genfs_do_io() to write to disk past the real end of the file.
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.66.8.1 src/sys/ufs/ext2fs/ext2fs_inode.c
cvs rdiff -u -r1.99 -r1.99.4.1 src/sys/ufs/ffs/ffs_inode.c
cvs rdiff -u -r1.120 -r1.120.10.1 src/sys/ufs/lfs/lfs_inode.c
cvs rdiff -u -r1.76.4.1 -r1.76.4.2 src/sys/ufs/ufs/ufs_inode.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 28 Feb 2010 23:39:58 +0000
State-Changed-Why:
This should be fixed in 5.0_STABLE and in HEAD; can you confirm?
State-Changed-From-To: feedback->closed
State-Changed-By: pooka@NetBSD.org
State-Changed-When: Tue, 29 Jun 2010 18:49:47 +0300
State-Changed-Why:
feedback timeout
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.