lkml.org 
[lkml]   [2008]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateSun, 13 Apr 2008 21:43:15 +0100
FromAl Viro <>
SubjectRe: [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?


\
 
 \ /
  Last update: 2008-04-13 22:45    [from the cache]
©2003-2010