NetBSD Problem Report #8815
Received: (qmail 23138 invoked from network); 17 Nov 1999 03:26:20 -0000
Message-Id: <199911170325.UAA20678@zoo>
Date: Tue, 16 Nov 1999 20:25:51 -0700 (MST)
From: jbernard@mines.edu
Reply-To: jbernard@mines.edu
To: gnats-bugs@gnats.netbsd.org
Subject: unable to remove some empty directories on lfs filesystem
X-Send-Pr-Version: 3.95
>Number: 8815
>Category: kern
>Synopsis: unable to remove some empty directories on lfs filesystem
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: perseant
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 16 19:27:01 +0000 1999
>Closed-Date: Sun Nov 21 19:26:15 +0000 1999
>Last-Modified: Sun Nov 21 19:26:54 +0000 1999
>Originator: Jim Bernard
>Release: November 16, 1999
>Organization:
Speaking for myself
>Environment:
System: NetBSD zoo 1.4L NetBSD 1.4L (ZOO) #0: Sat Oct 23 12:41:59 MDT 1999 local@zoo:/home/local/compile/sys/arch/i386/compile/ZOO i386
>Description:
While running a kernel built from sources supped on Nov. 14, I built
a new kernel from sources supped today (Nov. 16). The sources are
on an lfs filesystem, and I union mounted the source tree below a
scratch directory also on the same lfs filesystem. After the
compilation, I unmounted the union mount, installed the new kernel,
and rebooted under the new kernel. I then tried to delete the scratch
directory via "rm -rf" and received many messages saying that
such-and-such directory is not empty, and the directories were not
removed. "ls -la" showed no files or directories in the "leaf"
directories I checked, and "rmdir" also refused to delete them, saying
they were not empty. I booted the 2-day-old kernel and was able to
immediately delete the entire scratch tree with "rm -rf", as usual.
>How-To-Repeat:
See description. Note that simply doing "mkdir -p x/y; rm -rf x"
is not sufficient to cause the problem. I'm not sure what is a
minimal set of circumstances that causes it.
>Fix:
Unknown. But the soft updates merge did touch lfs, so I wonder if
something in that caused the problem.
>Release-Note:
>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: jbernard@mines.edu
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8815: unable to remove some empty directories on lfs filesystem
Date: Wed, 17 Nov 1999 09:52:02 +0100
On Tue, Nov 16, 1999 at 08:25:51PM -0700, jbernard@mines.edu wrote:
> Unknown. But the soft updates merge did touch lfs, so I wonder if
> something in that caused the problem.
I have troubles with a LFS with a pre-softupdates kernel.
Basically mounts points are dissapearing: I have /home mounted
(FFS) and after extrating a tar file to /usr/src (LFS) 'cd /home' is ok
but /home is now empty. 'umount /home' says 'invalid argument'.
I also got the same thing with /usr and /usr/src. Sounds like a vnode
problem ...
A few days ago I experienced a severe corruption of my /usr (with the root
inode deleted and many, many others bad things); I though it was RAM but it
was just after running a 'make build' on my LFS, maybe this LFS fault instead.
Could a corrupted vnode write back bad things on a disk ?
My LFS is 3G big, is someone else using such a large LFS ?
(btw, before recent changes to LFS (the 64bit arithemtic fix) I didn't have
any problems).
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
From: Jim Bernard <jbernard@ox.mines.edu>
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8815: unable to remove some empty directories on lfs filesystem
Date: Wed, 17 Nov 1999 06:53:26 -0700
On Wed, Nov 17, 1999 at 09:52:02AM +0100, Manuel Bouyer wrote:
> I have troubles with a LFS with a pre-softupdates kernel.
> Basically mounts points are dissapearing: I have /home mounted
> (FFS) and after extrating a tar file to /usr/src (LFS) 'cd /home' is ok
> but /home is now empty. 'umount /home' says 'invalid argument'.
> I also got the same thing with /usr and /usr/src. Sounds like a vnode
> problem ...
> A few days ago I experienced a severe corruption of my /usr (with the root
> inode deleted and many, many others bad things); I though it was RAM but it
> was just after running a 'make build' on my LFS, maybe this LFS fault instead.
> Could a corrupted vnode write back bad things on a disk ?
I haven't seen anything like this, but I've only been using lfs for a few
days.
> My LFS is 3G big, is someone else using such a large LFS ?
Yes, my /home is that large. That's where I had the problems last night.
BTW: I neglected to mention in the PR that I did not enable soft updates
in the kernel that exhibited the problem.
From: Jim Bernard <jbernard@ox.mines.edu>
To: gnats-bugs@gnats.netbsd.org
Cc: jbernard@ox.mines.edu
Subject: Re: kern/8815: unable to remove some empty directories on lfs filesystem
Date: Wed, 17 Nov 1999 18:04:39 -0700
On Tue, Nov 16, 1999 at 08:25:51PM -0700, jbernard@mines.edu wrote:
>
> >Number: 8815
> >Category: kern
> >Synopsis: unable to remove some empty directories on lfs filesystem
Some additional information (presented in the sequence in which it was
developed, so some of the later items refine statements given in earlier
items):
* I tried this again today, with sources supped today (Nov. 17), with
the same result. So it is definitely repeatable.
* While booted under the new kernel, and with no union mounts present,
I found the following in the scratch directory that was previously
used as the top level of a union mount to compile the kernel:
- rm -rf deletes all the files, but none of the directories
- I am able to create and delete new directories in many of the
subdirectories of the scratch directory, but in some subdirectories,
I lose that ability. For example, starting from the top of the
scratch directory (under which "src" was mounted during the compilation),
I tried:
cd sys
mkdir xxx [no problem]
rmdir xxx [no problem]
cd arch
mkdir xxx [no problem]
rmdir xxx [no problem]
cd i386
mkdir xxx ["mkdir: xxx: No such file or directory"]
touch xxx ["touch: xxx: No such file or directory"]
cd conf [NB: a subdirectory of i386]
touch xxx [no problem]
rm xxx [no problem]
mkdir xxx [no problem]
rmdir xxx [no problem]
rm -rf CVS [A directory created in conf during the compilation]
["rm: CVS: Directory not empty"]
- od -c on the above-mentioned CVS directory yields:
0000000 177 213 001 \0 \f \0 004 001 . \0 \0 \0 ~ 213 001 \0
0000020 364 001 004 002 . . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0001000
- If I do "mkdir xxx" (still in sys/arch/i386/conf, the parent of
the above-mentioned CVS directory) and "od -c xxx", it gives:
0000000 207 211 001 \0 \f \0 004 001 . \0 \0 \0 ~ 213 001 \0
0000020 364 001 004 002 . . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0001000
Except for the first 3 bytes (inode number??) this is the same as
the one above, and the same as what I see when a directory is made
on the lfs while booted under the Nov. 14 kernel (which doesn't
exhibit any of these anomalies).
- If I then do "mkdir yyy", I get "mkdir: yyy: No such file or directory",
but "rmdir xxx; mkdir yyy" succeeds.
- Generally, it seems impossible to make two directories in any of the
subdirectories, though making two files with touch works fine. This
behavior persists even above the scratch directory tree (but still
within the lfs filesystem). So, this means the synopsis of the PR
can be generalized to include the inability to create more than one
subdirectory in an existing directory in an lfs filesystem, and that
behavior is apparently independent of the prior use of a directory
in that filesystem as the top level of a union mount. So, this
simplifies the "how to repeat" sequence to:
boot a kernel built from sources at least as recent as Nov. 16
cd some_existing_lfs
mkdir xxx yyy [the second should fail]
Responsible-Changed-From-To: kern-bug-people->perseant
Responsible-Changed-By: perseant
Responsible-Changed-When: Thu Nov 18 09:38:45 PST 1999
Responsible-Changed-Why:
Became aware of the PR.
From: Konrad Schroder <perseant@hhhh.org>
To: Jim Bernard <jbernard@ox.mines.edu>
Cc: Frank van der Linden <frank@wins.uva.nl>, gnats-bugs@netbsd.org
Subject: Re: kern/8815
Date: Fri, 19 Nov 1999 10:20:37 -0800 (PST)
Found it: i_ffs_effnlink was not being initialized, so all directories
always looked like they had been deleted since the checkpoint. Please try
the enclosed patch....
Konrad Schroder
perseant@hhhh.org
Index: lfs_syscalls.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/lfs/lfs_syscalls.c,v
retrieving revision 1.35
diff -u -r1.35 lfs_syscalls.c
--- lfs_syscalls.c 1999/11/12 16:56:48 1.35
+++ lfs_syscalls.c 1999/11/20 00:13:54
@@ -993,6 +993,7 @@
*lfs_ifind(ump->um_lfs, ino, (struct dinode *)bp->b_data);
brelse(bp);
}
+ ip->i_ffs_effnlink = ip->i_ffs_nlink;
/*
* Initialize the vnode from the inode, check for aliases. In all
Index: lfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/lfs/lfs_vfsops.c,v
retrieving revision 1.44
diff -u -r1.44 lfs_vfsops.c
--- lfs_vfsops.c 1999/11/15 18:49:14 1.44
+++ lfs_vfsops.c 1999/11/20 00:13:54
@@ -717,6 +717,7 @@
return (error);
}
ip->i_din.ffs_din = *lfs_ifind(fs, ino, (struct dinode *)bp->b_data);
+ ip->i_ffs_effnlink = ip->i_ffs_nlink;
#ifdef LFS_ATIME_IFILE
ip->i_ffs_atime = ts.tv_sec;
ip->i_ffs_atimensec = ts.tv_nsec;
State-Changed-From-To: open->feedback
State-Changed-By: perseant
State-Changed-When: Fri Nov 19 16:24:37 PST 1999
State-Changed-Why:
Suggested patch.
From: Jim Bernard <jbernard@ox.mines.edu>
To: Konrad Schroder <perseant@hhhh.org>
Cc: Frank van der Linden <frank@wins.uva.nl>, gnats-bugs@netbsd.org
Subject: Re: kern/8815
Date: Fri, 19 Nov 1999 19:11:59 -0700
On Fri, Nov 19, 1999 at 10:20:37AM -0800, Konrad Schroder wrote:
> Found it: i_ffs_effnlink was not being initialized, so all directories
> always looked like they had been deleted since the checkpoint. Please try
> the enclosed patch....
That did the trick! Thanks!
--Jim
State-Changed-From-To: feedback->closed
State-Changed-By: perseant
State-Changed-When: Sun Nov 21 11:26:15 PST 1999
State-Changed-Why:
Patch verified by submitter, and committed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.