public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Artem Bityutskiy <dedekind@yandex.ru>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: is the inode an orphan?
Date: Thu, 18 Oct 2007 19:01:52 +0100	[thread overview]
Message-ID: <20071018180152.GO8181@ftp.linux.org.uk> (raw)
In-Reply-To: <47179CAE.6010806@yandex.ru>

On Thu, Oct 18, 2007 at 08:49:34PM +0300, Artem Bityutskiy wrote:
> Hi,
> 
> I need a help from VFS folks: when I'm in ->unlink() in is there a safe way 
> to to realize that ->delete_inod()e is going to be called? IOW, I'd like to 
> call myfs_delete_inode() myself form ->unlink(), and not wait for VFS 
> calling ->delete_inode().
> 
> Or to put it differently, I'd like to know if the inode is an orphan or not 
> in ->unlink()?
> 
> AFAICS, if (inode->i_nlink == 0 && atomic_read(&inode->i_count) == 2) then 
> this file is not going to be an orphan. And AFAIC judge, it is safe to use 
>  this, but I'm not sure and kindly ask for help.

Define orphan.  It might very well be still opened after the only link
to it had been removed and you still will get IO on it.

  reply	other threads:[~2007-10-18 18:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18 17:49 is the inode an orphan? Artem Bityutskiy
2007-10-18 18:01 ` Al Viro [this message]
2007-10-19  7:07   ` Artem Bityutskiy
2007-10-30 14:10     ` Jan Kara
2007-11-19 15:02       ` Artem Bityutskiy

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=20071018180152.GO8181@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=dedekind@yandex.ru \
    --cc=linux-kernel@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