Message ID | 5527C9A0.6030502@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Kinglong Mee <kinglongmee@gmail.com> wrote: > If netfs exist, fscache must put the reference of parent's > usage and n_children, otherwise, never be decreased. Good catch. Though it might be preferable to only increment the counters if the list_add() is done. David -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 4/13/2015 7:33 PM, David Howells wrote: > Kinglong Mee <kinglongmee@gmail.com> wrote: > >> If netfs exist, fscache must put the reference of parent's >> usage and n_children, otherwise, never be decreased. > > Good catch. Though it might be preferable to only increment the counters if > the list_add() is done. Thanks for your comments, that's great. I will update and resend those two patch. Thanks, Kinglong Mee -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Kinglong Mee <kinglongmee@gmail.com> wrote: > > Good catch. Though it might be preferable to only increment the counters if > > the list_add() is done. > > Thanks for your comments, that's great. > I will update and resend those two patch. In fact, kmem_cache_free() can be called instead of fscache_relinquish_cookie() in that case. David -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/fscache/netfs.c b/fs/fscache/netfs.c index 6d941f5..b16afba 100644 --- a/fs/fscache/netfs.c +++ b/fs/fscache/netfs.c @@ -71,8 +71,7 @@ already_registered: up_write(&fscache_addremove_sem); if (ret < 0) { - netfs->primary_index->parent = NULL; - __fscache_cookie_put(netfs->primary_index); + fscache_relinquish_cookie(netfs->primary_index, 0); netfs->primary_index = NULL; }
If netfs exist, fscache must put the reference of parent's usage and n_children, otherwise, never be decreased. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> --- fs/fscache/netfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)