Re: [PATCH 5/6] IMA: use rbtree instead of radix tree for inode information cache

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

 



On Tue, Oct 19, 2010 at 06:58:39PM -0400, Eric Paris wrote:
> @@ -36,12 +63,11 @@ struct ima_iint_cache *ima_iint_find_get(struct inode *inode)
>  	struct ima_iint_cache *iint;
>  
>  	rcu_read_lock();
> -	iint = radix_tree_lookup(&ima_iint_store, (unsigned long)inode);
> -	if (!iint)
> -		goto out;
> -	kref_get(&iint->refcount);
> -out:
> +	iint = __ima_iint_find(inode);
> +	if (iint)
> +		kref_get(&iint->refcount);
>  	rcu_read_unlock();
> +

This is wrong - the rbtree is protected only by the ima_iint_lock(),
not RCU. Hence you can't do lockless lookups on an rbtree in this
manner as they will race with inserts and deletes.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
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