[CRIU] [PATCH] mount: mnt_entry_alloc -- Don't forget to init @mnt_slave

Pavel Emelyanov xemul at parallels.com
Tue Sep 1 02:32:31 PDT 2015


On 08/27/2015 06:42 PM, Cyrill Gorcunov wrote:
> On Thu, Aug 27, 2015 at 06:23:24PM +0300, Andrew Vagin wrote:
>> On Thu, Aug 27, 2015 at 05:17:30PM +0300, Cyrill Gorcunov wrote:
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  mount.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/mount.c b/mount.c
>>> index 3f8fe81f60bb..478e71d86c15 100644
>>> --- a/mount.c
>>> +++ b/mount.c
>>> @@ -2268,6 +2268,7 @@ struct mount_info *mnt_entry_alloc()
>>>  		INIT_LIST_HEAD(&new->children);
>>>  		INIT_LIST_HEAD(&new->siblings);
>>>  		INIT_LIST_HEAD(&new->mnt_slave_list);
>>> +		INIT_LIST_HEAD(&new->mnt_slave);
>>
>> new->mnt_slave is entry
>> new->mnt_slave_list is head for new->mnt_slave entries
>>
>> Why do we need to initialize it?
> 
> Because it's a separate routine called "mnt_entry_alloc",
> it has no clue how would we use any of this list entries.
> So I think it's better to init this entry, frankly its
> just a few cpu ops.
> .
> 

Kernel doesn't initialize list-entries without need either :) Only
heads. So I'd just add a comment somewhere saying this.


More information about the CRIU mailing list