Re: [PATCH] fork: Use helper function mapping_allow_writable() in dup_mmap()

From: Eric W. Biederman
Date: Mon Sep 14 2020 - 13:47:32 EST


linmiaohe <linmiaohe@xxxxxxxxxx> writes:

> Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>> Miaohe Lin <linmiaohe@xxxxxxxxxx> writes:
>>
>>> Use helper function mapping_allow_writable() to atomic_inc
>>> i_mmap_writable.
>>
>>Why?
>>
>
> Because I think it's better to use the wrapper function instead of the
> open hard code.

My point is there is no context in this commit message.

What makes it better to use the wrapper function?
What makes the wrapper function the appropriate function to use?
Why just this location?
Why wasn't this change made when the wrapper function was introduced?

I could probably read through the code and figure these things out
but the description of the change should really include these things.

Eric