Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Aug 2002 18:06:51 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Rashim Gupta <guptar@cs.rpi.edu>
Cc:        "David E. Cross" <crossd@cs.rpi.edu>, fs@freebsd.org
Subject:   Re: vnodes (UFS journaling)?
Message-ID:  <3D51C42B.8C406A60@mindspring.com>
References:  <Pine.GSO.4.31.0208072033520.24055-100000@dishwasher.cs.rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Rashim Gupta wrote:
> we are trying to implement a logging facility for the File System. Hence
> we need to open the log file and keep its vnode open throughout the
> duration while the system is mounted. Hence, we cannot free the vnode
> after searching for it using the root file system since we need to access
> it later on. However, if we do not
> return the vnode, then doing an "ls -al" in the dirctory where the log
> file is present hangs the kernel.
> 
> Any suggestions how we can solve this problem.

AHA!

It was confusing because David kept referencing that this was
a journalling FS, not a project to just do metadata logging ala
ReiserFS.

You are trying to do this the wrong way.  Ideally, you would
not be using a log file which was a *file*.

However...

You can still use a file for this, on the FS, but it's a
moderately ugly thing to do it by vnode (if you put the log
file on another FS, you can get an undetectable deadly
embrace deadlock as a result of mutual locking).

The code you want to look at for an example that does what you
want to do is in /usr/src/sys/ufs/ufs/ufs_quota.c.

Specifically, look at the quotaon(), quotaoff(), aysync(),
dqget(), dqsync(), and dqrele() code.

Note that the vnode references in um_quotas[] are held in the
in core mount structure, and do not interfere with the ability
to deal with the "ls" case you are worried about, because the
references are held... but not locked at the time an "ls"
occurs.

-- 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?3D51C42B.8C406A60>