From: Jan Hudec <bulb@ucw.cz>
To: linux-fsdevel@vger.kernel.org
Subject: Re: a problem with dget
Date: Wed, 26 Mar 2003 10:23:20 +0100 [thread overview]
Message-ID: <20030326092320.GB24147@vagabond> (raw)
In-Reply-To: <Pine.LNX.4.44_heb2.09.0303251702370.4846-100000@ruby>
On Tue, Mar 25, 2003 at 06:47:00PM +0200, Nir Tzachar wrote:
> hello all.
>
> i encountered a strange problem, involving the reference count of
> dentries.
>
> first, let me describe my file system (i'll be brief.. ):
> im implementing a file system which is supposed to emulate an object
> storage device. i use a wrapper like file system (much like wrapfs,
> and actually based on it) to store files on an underlying f/s as objects.
>
> i hope someone can help me, i've been tackling this problem for more than
> a week: when i create a file(say "tmp"), all is fine.
> the problem arises when i umount and then remount the file system.
> after im done with lookup (inode->i_op->lookup), dentry->d_count.counter
> ==1, as should be. but, when i enter the unlink function
> (inode->i_op->unlink ) its dentry->d_count.counter == 0 . why is that?
> nowhere in the vfs code does anyone decreases the counter b4
> inode->i_op->unlink is called . am i right?
Isn't that the little confusing semantics of lookup that's biting you?
When ->lookup returns non-NULL, real_lookup (the caller) puts the dentry
passed to ->lookup. So if you fill it in, you must return NULL and *NOT*
the dentry you recieved!
> the problem happens every time i try to do a dget an any dentry.
Yes, because you need to hold a reference to do dget.
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
next prev parent reply other threads:[~2003-03-26 9:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-25 16:47 a problem with dget Nir Tzachar
2003-03-26 9:23 ` Jan Hudec [this message]
2003-03-26 9:45 ` Nir Tzachar
2003-03-26 9:57 ` Jan Hudec
2003-03-26 20:43 ` [FiST] " Jerome de Vivie
2003-03-27 8:17 ` Nir Tzachar
2003-03-28 2:01 ` Erez Zadok
2003-03-30 4:29 ` Nir Tzachar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030326092320.GB24147@vagabond \
--to=bulb@ucw.cz \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox