Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Oct 2002 21:51:55 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        "David E. Cross" <crossd@cs.rpi.edu>
Cc:        freebsd-fs@freebsd.org, guptar@cs.rpi.edu
Subject:   Re: UFS, Inode question
Message-ID:  <3DA2646B.45D024AB@mindspring.com>
References:  <200210080439.g984drE16529@pegasus.cs.rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
"David E. Cross" wrote:
> Our current method independently stores inode allocation
> and linking as discrete events.  The problem arises if one is committed
> without the other (think an inopportune break point in the disk-journal
> vs. in-core journal.)  That could lead to an inode being allocated, but not
> actually referenced.
> 
> What does the system do with an inode with a reference count of 0, is that
> a free inode (on the "free list").  Or can it still be an unreferenced inode?
> If it can be unreferenced then we need to rethink some things here as the
> entire point is to avoid fsck.

These answers are for "fsck -y"; for manual fsck, the answers will
depend on your interaction with the fsck program...

Unreferenced inodes are not free unless they are marked free in the
bitmap.  A fsck will mark the free, if they have a zero reference
count.

An inode with no directory references, but a postive reference count
is assumed to have lost its directory entry, and is linked into the
lost+found directory.

An inode with a zero reference count, but a directory reference to
it is assumed to have been a failure during create, and is removed
(a failure during delete would leave a positive reference count,
and either a directory entry, or no directory entry; in the former
case, "the file is there"; the latter case is already covered).


The one thing you should be careful of here is to increase and
commit the link count change to the inode before making the
referencing directory entry (UFS does this already).

Actually, every place soft updates creates a dependency, you could
create a log entry, and you'd pretty much be "done"...

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DA2646B.45D024AB>