[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080413204315.GQ9785@ZenIV.linux.org.uk>
Date: Sun, 13 Apr 2008 21:43:15 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Pekka J Enberg <penberg@...helsinki.fi>
Cc: alan@...hat.com, hch@...radead.org, peterz@...radead.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [RFC/PATCH 4/8] revoke: core code V7
On Fri, Dec 14, 2007 at 05:16:54PM +0200, Pekka J Enberg wrote:
> +static void revoke_aliases(struct inode *inode)
> +{
> + struct dentry *dentry;
> +restart:
> + spin_lock(&dcache_lock);
> + list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
> + spin_lock(&dentry->d_lock);
> + if (!d_unhashed(dentry)) {
> + dget_locked(dentry);
> + __d_drop(dentry);
> + spin_unlock(&dentry->d_lock);
> + spin_unlock(&dcache_lock);
> + dput(dentry);
> + goto restart;
> + }
> + spin_unlock(&dentry->d_lock);
> + }
> + spin_unlock(&dcache_lock);
> +}
Don't do that to directories, kids...
> +static int revoke_files(struct inode *inode)
> +{
> + struct super_block *sb;
> + struct file *file;
> + int err = 0;
> +
> + sb = inode->i_sb;
> + if (!sb)
> + return -EINVAL;
> +
> +restart:
> + file_list_lock();
> + list_for_each_entry(file, &sb->s_files, f_u.fu_list) {
> + struct dentry *dentry = file->f_path.dentry;
> +
> + if (dentry->d_inode != inode)
> + continue;
> +
> + if (file->f_op != inode->i_fop)
> + continue;
Skip everything that has reassigned ->f_op in open()? That includes all
char devices, to start with...
> + err = file->f_op->revoke(file);
> + make_revoked_file(inode, file);
*Um*
Where exactly do we terminate operations in progress and how the devil is
locking supposed to be done in driver?
--
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