Re: [PATCH] mm: mmap: Check all failures before set values

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

 



On 8/24/15 21:57, Michal Hocko wrote:
> On Mon 24-08-15 21:34:25, Chen Gang wrote:

[...]


>> It is always a little better to let the external function suppose fewer
>> callers' behalf.
> 
> I am sorry but I do not understand what you are saying here.
> 

Execuse me, my English maybe be still not quite well, my meaning is:

 - For the external functions (e.g. insert_vm_struct in our case), as a
   callee, it may have to supose something from the caller.

 - If we can keep callee's functional contents no touch, a little fewer
   supposing will let callee a little more independent from caller.

 - If can keep functional contens no touch, the lower dependency between
   caller and callee is always better.


>> It can save the code readers' (especially new readers') time resource
>> to avoid to analyze why set 'vma->vm_pgoff' before checking '-ENOMEM'
>> (may it cause issue? or is 'vm_pgoff' related with the next checking?).
> 
> Then your changelog should be specific about these reasons. "not a good
> idea" is definitely not a good justification for a patch. I am not
> saying the patch is incorrect I just do not sure it is worth it. The
> code is marginally better. But others might think otherwise. The
> changelog needs some more work for sure.
> 

OK, thanks. The comments needs to be improved.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]