public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Alexander Viro <viro@math.psu.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: hundreds of mount --bind mountpoints?
Date: 24 Apr 2001 23:59:55 +0200	[thread overview]
Message-ID: <shszod6j6w4.fsf@charged.uio.no> (raw)
In-Reply-To: <Pine.GSO.4.21.0104232241130.4968-100000@weyl.math.psu.edu>
In-Reply-To: Alexander Viro's message of "Mon, 23 Apr 2001 22:53:15 -0400 (EDT)"

>>>>> " " == Alexander Viro <viro@math.psu.edu> writes:

     > On Mon, 23 Apr 2001, Jan Harkes wrote:

    >> On Mon, Apr 23, 2001 at 10:45:05PM +0200, Ingo Oeser wrote:

    >> > BTW: Is it still less than one page? Then it doesn't make me
    >> >    nervous. Why? Guess what granularity we allocate at, if we
    >> >    just store pointers instead of the inode.u. Or do you like
    >> >    every FS creating his own slab cache?

     > Oh, for crying out loud. All it takes is half an hour per
     > filesystem.  Here - completely untested patch that does it for
     > NFS. Took about that long. Absolutely straightforward, very
     > easy to verify correctness.

     > Some stuff may need tweaking, but not much (e.g. some functions
     > should take nfs_inode_info instead of inodes, etc.). From the
     > look of flushd cache it seems that we would be better off with
     > cyclic lists instead of single-linked ones for the hash, but I
     > didn't look deep enough.

     > So consider the patch below as proof-of-concept. Enjoy:

Hi Al,

  I believe your patch introduces a race for the NFS case. The problem
lies in the fact that nfs_find_actor() needs to read several of the
fields from nfs_inode_info. By adding an allocation after the inode
has been hashed, you are creating a window during which the inode can
be found by find_inode(), but during which you aren't even guaranteed
that the nfs_inode_info exists let alone that it's been initialized
by nfs_fill_inode().

One solution could be to have find_inode sleep on encountering a
locked inode. It would have to be something along the lines of

static struct inode * find_inode(struct super_block * sb, unsigned long ino, struct list_head *head, find_inode_t find_actor, void *opaque)
{
        struct list_head *tmp;
        struct inode * inode;

        tmp = head;
        for (;;) {
                tmp = tmp->next;
                inode = NULL;
                if (tmp == head)
                        break;
                inode = list_entry(tmp, struct inode, i_hash);
                if (inode->i_ino != ino)
                        continue;
                if (inode->i_sb != sb)
                        continue;
                if (find_actor) {
                        if (inode->i_state & I_LOCK) {
                                spin_unlock(&inode_lock);
                                __wait_on_inode(inode);
                                spin_lock(&inode_lock);
                                tmp = head;
                                continue;
                        }
                        if (!find_actor(inode, ino, opaque))
                                continue;
                }
                break;
        }
        return inode;
}


Cheers,
   Trond

  parent reply	other threads:[~2001-04-24 22:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-22 16:32 hundreds of mount --bind mountpoints? David L. Parsley
2001-04-22 16:41 ` Alexander Viro
2001-04-23 11:43 ` Christoph Rohland
2001-04-23 13:17   ` Ingo Oeser
2001-04-23 14:54     ` Christoph Rohland
2001-04-23 15:23       ` Ingo Oeser
2001-04-23 15:36         ` Alexander Viro
2001-04-23 20:45           ` Ingo Oeser
2001-04-23 20:56             ` Christoph Hellwig
2001-04-23 22:00               ` Ingo Oeser
2001-04-23 22:10                 ` Alexander Viro
2001-04-23 21:19             ` Richard Gooch
2001-04-23 22:42               ` Albert D. Cahalan
2001-04-23 22:49                 ` Richard Gooch
2001-04-23 23:07                   ` Alexander Viro
2001-04-23 23:13                     ` Richard Gooch
2001-04-23 23:24                     ` Rik van Riel
2001-04-23 22:47             ` Andreas Dilger
2001-04-24  1:37             ` Jan Harkes
2001-04-24  2:53               ` Alexander Viro
2001-04-24  9:58                 ` David Woodhouse
2001-04-24 10:07                   ` Alexander Viro
2001-04-24 10:19                     ` David Woodhouse
2001-04-24 10:35                     ` Christoph Rohland
2001-04-24 10:54                       ` Alexander Viro
2001-04-24 12:51                         ` David Woodhouse
2001-04-24 13:34                         ` Christoph Rohland
2001-04-24 16:52                           ` David L. Parsley
2001-05-05  7:48                             ` [Patch] inline symlinks for tmpfs Christoph Rohland
2001-05-04 19:17                           ` [Patch] encapsulate shmem access to shmem_inode_info Christoph Rohland
     [not found]                             ` <3AF405FC.11D37FEB@bellsouth.net>
2001-05-06 13:58                               ` [Resend] Collection of tmpfs patches Christoph Rohland
2001-04-24 16:04                         ` Can't read SCSI TAPE Masaki Tsuji
2001-04-24 18:36                         ` hundreds of mount --bind mountpoints? Andreas Dilger
2001-04-24 18:49                           ` Alexander Viro
2001-04-24 19:11                             ` Andreas Dilger
2001-04-24 22:01                             ` Ingo Oeser
2001-04-24 21:59                 ` Trond Myklebust [this message]
2001-04-24 22:09                   ` Alexander Viro
2001-04-24 22:31                     ` Trond Myklebust
2001-04-24  6:33           ` Christoph Rohland
2001-04-23 14:08   ` David L. Parsley
2001-04-23 14:14     ` Alexander Viro
  -- strict thread matches above, loose matches on Subject: below --
2001-04-24  0:16 Ed Tomlinson
2001-04-24  3:56 ` Andreas Dilger
2001-04-24 10:01   ` Alexander Viro
2001-04-24 13:27     ` Erik Mouw
2001-04-24 18:47       ` Andreas Dilger
2001-04-24 18:52         ` Alexander Viro
2001-04-24 20:45         ` Erik Mouw
2001-04-25  7:25         ` Christoph Rohland
2001-04-25 18:39     ` Andreas Dilger
2001-04-25 18:47       ` Alexander Viro

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=shszod6j6w4.fsf@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /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