public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Carsten Otte <cotte@de.ibm.com>, Carsten Otte <cotte@freenet.de>,
	linux-fsdevel@vger.kernel.org, sct@redhat.com,
	Al Viro <viro@parcelfarce.linux.theplanet.co.uk>,
	Dave Kleikamp <shaggy@austin.ibm.com>
Subject: Re: [PATCH] ext3 [linux-2.6.2.]: accessing already freed inodes when under memory pressure
Date: Tue, 30 Mar 2004 15:16:37 +0100	[thread overview]
Message-ID: <20040330141637.GI7709@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1080653969.24117.192.camel@hades.cambridge.redhat.com>

On Tue, Mar 30, 2004 at 02:39:30PM +0100, David Woodhouse wrote:
> If we ignore the anecdotes about reinstating a libc which has been
> unlinked but is still in use -- is there any reason we're want any file
> system to allow link() to inodes with i_nlink == 0?

To preserve the anecdotes, we could check i_count as well, but this starts
to get hairy.  If iput_final() races with vfs_link() we'd have problems.
Should iput_final() be taking i_sem anyway?  Seems to me we have the race:

CPU0					CPU1

iput()
atomic_dec_and_lock(&inode->i_count, &inode_lock)
					sys_unlink()
					atomic_inc(&inode->i_count);
					vfs_unlink()
					inode->i_nlink-- (reaches 0)
iput_final()
generic_drop_inode()
					
if (!inode->i_nlink)
        generic_delete_inode(inode);
else
        generic_forget_inode(inode);
					iput()
					atomic_dec_and_lock()
					generic_delete_inode()

Calling generic_delete_inode() twice gives us a BUG() in clear_inode()
(if we even get that far).  Have I overlooked something here?	

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

  reply	other threads:[~2004-03-30 14:16 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-30 11:57 [PATCH] ext3 [linux-2.6.2.]: accessing already freed inodes when under memory pressure Martin Schwidefsky
2004-03-30 13:39 ` David Woodhouse
2004-03-30 14:16   ` Matthew Wilcox [this message]
2004-03-30 15:51   ` Linus Torvalds
2004-04-02 16:12     ` viro
2004-04-02 18:01       ` viro
2004-04-02 18:52         ` Linus Torvalds
2004-04-02 19:02           ` Linus Torvalds
2004-04-02 19:10             ` viro
2004-04-02 19:07           ` viro
2004-04-02 20:23             ` viro
2004-04-02 22:40               ` Trond Myklebust
2004-04-02 23:06                 ` viro
2004-04-02 23:23                   ` Trond Myklebust
2004-04-03  0:53                     ` Neil Brown
2004-04-02 23:19                 ` Trond Myklebust
2004-04-02 19:17           ` Jamie Lokier
2004-04-02 19:25             ` viro
2004-04-02 19:32             ` Linus Torvalds
2004-04-02 19:37               ` viro
2004-04-02 19:45                 ` Linus Torvalds
2004-04-02 20:08                   ` viro
2004-04-02 20:40               ` Jamie Lokier
2004-04-02 20:59                 ` Christoph Hellwig
2004-04-02 21:09                   ` viro
2004-04-02 23:42                   ` Jamie Lokier
2004-04-02 21:08                 ` viro
2004-04-03  0:39                   ` Jamie Lokier
2004-04-05 14:07                   ` Stephen C. Tweedie
2004-03-30 15:07 ` Linus Torvalds
2004-04-02 16:14   ` viro
  -- strict thread matches above, loose matches on Subject: below --
2004-03-30 15:13 Martin Schwidefsky
2004-03-29 19:07 Martin Schwidefsky
2004-03-29 20:11 ` Linus Torvalds
2004-03-29 20:29   ` Dave Kleikamp
2004-02-19 18:00 Martin Schwidefsky
2004-02-19 12:21 Carsten Otte
2004-02-19 16:53 ` Linus Torvalds
2004-02-19 17:39   ` Stephen C. Tweedie
2004-02-19 18:49     ` Andrew Morton
2004-02-19 20:28       ` Carsten Otte
2004-02-19 20:26         ` viro
2004-02-19 20:35           ` Carsten Otte
2004-02-19 20:14     ` Carsten Otte
2004-02-20  3:41       ` Andrew Morton
2004-02-19 20:19   ` Carsten Otte
     [not found] ` <20040220164325.659c4e45.akpm@osdl.org>
     [not found]   ` <200402241338.57855.cotte@freenet.de>
2004-02-24 22:55     ` Andrew Morton

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=20040330141637.GI7709@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=akpm@osdl.org \
    --cc=cotte@de.ibm.com \
    --cc=cotte@freenet.de \
    --cc=dwmw2@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sct@redhat.com \
    --cc=shaggy@austin.ibm.com \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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