Re: [PATCH] ovl: fix dir cache leak for ovl_cache_get

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

 



Hi, Amir:

> This is not a leak. dir cache is refcounted and freed on
> ovl_dir_{release|reset}() -> ovl_cache_put()

Here is the snippet:

if (cache && ovl_dentry_version_get(dentry) == cache->version) {
cache->refcount++;
return cache;
}

ovl_set_dir_cache(dentry, NULL);

I am a little confused here. From the logic of the code, there must
have a circumstance --- cache is not NULL and
ovl_dentry_version_get(dentry) != cache->version. If
ovl_set_dir_cache(dentry, NULL), we can't find the old dir cache  form
dentry and struct file(later, file->private_data->cache will point at
the same dir cache with dentry). How could we free it in
ovl_dir_{release|reset} ?

BTW, could you please an example when ovl_dentry_version_get(dentry)
!= cache->version in ovl_cache_get ?

Thanks for your time.
-- 
Cheers,
Rock
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux