Message ID | 538988F7.8090805@huawei.com |
---|---|
State | Not Applicable |
Headers | show |
On Sat, 2014-05-31 at 15:47 +0800, hujianyang wrote: > Hi Artem, > > In previous mail, I introduce a condition I found that may hit assert > failed in shrink_tnc(). So I think this assertion is useless. But I > don't know if there are any leaks in @c->clean_zn_cnt. Although I've > done some tests and found everything is OK, I'm still not sure of that. Yes, this sounds like a great idea. Could you please send a proper patch containing this change (S-o-b, etc). Many thanks!
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index 9083bc7..61914f0 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -2859,10 +2859,11 @@ void ubifs_tnc_close(struct ubifs_info *c) { tnc_destroy_cnext(c); if (c->zroot.znode) { - long n; + long n, freed; - ubifs_destroy_tnc_subtree(c->zroot.znode); + freed = ubifs_destroy_tnc_subtree(c->zroot.znode); n = atomic_long_read(&c->clean_zn_cnt); + ubifs_assert(freed == n); atomic_long_sub(n, &ubifs_clean_zn_cnt); } kfree(c->gap_lebs);