[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20060928232953.6da08f19.akpm@osdl.org>
Date: Thu, 28 Sep 2006 23:29:53 -0700
From: Andrew Morton <akpm@...l.org>
To: NeilBrown <neilb@...e.de>,
"David M. Grimes" <dgrimes@...isite.com>,
Atal Shargorodsky <atal@...efidence.com>,
Gilad Ben-Yossef <gilad@...efidence.com>
Cc: nfs@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
Hugh Dickins <hugh@...itas.com>
Subject: Re: [PATCH 001 of 8] knfsd: Add nfs-export support to tmpfs
On Fri, 29 Sep 2006 13:08:39 +1000
NeilBrown <neilb@...e.de> wrote:
> +static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, int connectable)
> +{
> + struct inode *inode = dentry->d_inode;
> +
> + if (*len < 2)
> + return 255;
> +
> + if (hlist_unhashed(&inode->i_hash)) {
> + /* Unfortunately insert_inode_hash is not idempotent,
> + * so as we hash inodes here rather than at creation
> + * time, we need a lock to ensure we only try
> + * to do it once
> + */
> + static DEFINE_SPINLOCK(lock);
> + spin_lock(&lock);
> + if (hlist_unhashed(&inode->i_hash))
> + insert_inode_hash(inode);
> + spin_unlock(&lock);
> + }
This looks fishy.
How do we get two callers in here at the same time for the same inode?
Why don't other filesystems have the same problem?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists