[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <051fa302-f4c2-cc90-7a12-eaedfa806e73@oracle.com>
Date: Wed, 21 Mar 2018 15:53:56 -0700
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Laurent Dufour <ldufour@...ux.vnet.ibm.com>,
Michal Hocko <mhocko@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Andrea Arcangeli <aarcange@...hat.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2] shm: add split function to shm_vm_ops
On 03/21/2018 01:56 PM, Andrew Morton wrote:
> On Wed, 21 Mar 2018 09:13:14 -0700 Mike Kravetz <mike.kravetz@...cle.com> wrote:
>>
>> +static int shm_split(struct vm_area_struct *vma, unsigned long addr)
>> +{
>> + struct file *file = vma->vm_file;
>> + struct shm_file_data *sfd = shm_file_data(file);
>> +
>> + if (sfd->vm_ops && sfd->vm_ops->split)
>> + return sfd->vm_ops->split(vma, addr);
>
> This will be the only site which tests for NULL shm_file_data.vm_ops.
> It's a can't-happen, methinks.
You are correct, thanks for catching this.
>
> I think I'll leave it as it is for now and will queue up a non-urgent
> patch:
>
>
>
> From: Andrew Morton <akpm@...ux-foundation.org>
> Subject: ipc/shm.c: shm_split(): remove unneeded test for NULL shm_file_data.vm_ops
>
> This was added by the recent "ipc/shm.c: add split function to
> shm_vm_ops", but it is not necessary.
>
> Cc: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Davidlohr Bueso <dave@...olabs.net>
> Cc: Manfred Spraul <manfred@...orfullife.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Looks good, FWIW
Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
--
Mike Kravetz
> ---
>
> ipc/shm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN ipc/shm.c~ipc-shmc-shm_split-remove-unneeded-test-for-null-shm_file_datavm_ops ipc/shm.c
> --- a/ipc/shm.c~ipc-shmc-shm_split-remove-unneeded-test-for-null-shm_file_datavm_ops
> +++ a/ipc/shm.c
> @@ -391,7 +391,7 @@ static int shm_split(struct vm_area_stru
> struct file *file = vma->vm_file;
> struct shm_file_data *sfd = shm_file_data(file);
>
> - if (sfd->vm_ops && sfd->vm_ops->split)
> + if (sfd->vm_ops->split)
> return sfd->vm_ops->split(vma, addr);
>
> return 0;
> _
>
Powered by blists - more mailing lists