[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ac8f92701003260712g856d76ewbcdf2b20bff3ed7e@mail.gmail.com>
Date: Fri, 26 Mar 2010 22:12:08 +0800
From: jing zhang <zj.barak@...il.com>
To: "Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc: Andreas Dilger <adilger@....com>, tytso@....edu,
linux-ext4 <linux-ext4@...r.kernel.org>,
Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: memory leakage in ext4_discard_preallocations
2010/3/26, Aneesh Kumar K. V <aneesh.kumar@...ux.vnet.ibm.com>:
> On Sat, 20 Mar 2010 22:05:13 +0800, jing zhang <zj.barak@...il.com> wrote:
>>
>> Evening,
>>
>> Thanks Andreas and Ted for your good explanations to deal error in
>> gentle way, and I got it that the chance may exist since the pa is not
>> deleted from its group_list yet.
>>
>> And it also seems that there is work deserved.
>> - zj
>>
>> ---
>>
>> --- linux-2.6.32/fs/ext4/mballoc.c 2009-12-03 11:51:22.000000000 +0800
>> +++ fs/mballoc.c 2010-03-20 21:40:04.000000000 +0800
>> @@ -3788,14 +3788,14 @@ repeat:
>> err = ext4_mb_load_buddy(sb, group, &e4b);
>> if (err) {
>> ext4_error(sb, __func__, "Error in loading buddy "
>> - "information for %u", group);
>> + "information for group %u inode %lu", group, inode->i_ino);
>> continue;
>> }
>>
>> bitmap_bh = ext4_read_block_bitmap(sb, group);
>> if (bitmap_bh == NULL) {
>> ext4_error(sb, __func__, "Error in reading block "
>> - "bitmap for %u", group);
>> + "bitmap for group %u inode %lu", group, inode->i_ino);
>> ext4_mb_release_desc(&e4b);
>> continue;
>> }
>> @@ -3811,6 +3811,14 @@ repeat:
>> list_del(&pa->u.pa_tmp_list);
>> call_rcu(&(pa)->u.pa_rcu, ext4_mb_pa_callback);
>> }
>> + if (! list_empty(&list)) {
>> + /*
>> + * we have to do something for the check in
>> + * the function, ext4_mb_discard_group_preallocations()
>> + */
>> + list_for_each_entry(pa, &list, u.pa_tmp_list)
>> + pa->pa_deleted = 0;
>> + }
>> if (ac)
>> kmem_cache_free(ext4_ac_cachep, ac);
>> }
>
> Can you add a comment saying if we fail to load buddy or read block
> bitmap we skip freeing the prealloc space. So mark it undeleted. The
> prealloc space is still removed from the inode but it is linked to the
> group prealloc list via (pa_group_list)
>
>
> -aneesh
>
/*
* here the tricky is to mark PAs undeleted,
* since they are still on their pa_group_list.
*/
That is it, Aneesh.
I am still waiting for comments, if any, from Ted, since I am not sure
the tricky is safe enough. And I am able not to deliver better patch
tonight :(
- zj
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists