Re: [RFC/PATCH 4/8] revoke: core code V7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux