Re: [PATCH 01/18] vfs: dentry_unhash immediately prior to rmdir

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

 



> -	dentry_unhash(dentry);
>  	if (d_mountpoint(dentry))
>  		error = -EBUSY;
>  	else {
>  		error = security_inode_rmdir(dir, dentry);
>  		if (!error) {
> +			dentry_unhash(dentry);
>  			error = dir->i_op->rmdir(dir, dentry);
>  			if (!error) {
>  				dentry->d_inode->i_flags |= S_DEAD;
>  				dont_mount(dentry);
>  			}
> +			dput(dentry);
>  		}
>  	}
>  	mutex_unlock(&dentry->d_inode->i_mutex);
>  	if (!error) {
>  		d_delete(dentry);
>  	}
> -	dput(dentry);
>  
>  	return error;

It would be nice if you could throw in a patch later in the series to
clean up the code flow, e.g.

	error = -EBUSY;
  	if (d_mountpoint(dentry))
		goto out;

	error = security_inode_rmdir(dir, dentry);
	if (error)
		goto out;

	dentry_unhash(dentry);
	error = dir->i_op->rmdir(dir, dentry);
	if (!error) {
		dentry->d_inode->i_flags |= S_DEAD;
		dont_mount(dentry);
	}
	dput(dentry);

out:
 	mutex_unlock(&dentry->d_inode->i_mutex);
  	if (!error)
 		d_delete(dentry);
 	return error;
}
--
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