LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Laurent Dufour <ldufour@linux.vnet.ibm.com>,
	Michal Hocko <mhocko@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] shm: add split function to shm_vm_ops
Date: Wed, 21 Mar 2018 15:53:56 -0700	[thread overview]
Message-ID: <051fa302-f4c2-cc90-7a12-eaedfa806e73@oracle.com> (raw)
In-Reply-To: <20180321135618.f3d4a0c30d9f413ce4092ddf@linux-foundation.org>

On 03/21/2018 01:56 PM, Andrew Morton wrote:
> On Wed, 21 Mar 2018 09:13:14 -0700 Mike Kravetz <mike.kravetz@oracle.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@linux-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@linux.vnet.ibm.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Davidlohr Bueso <dave@stgolabs.net>
> Cc: Manfred Spraul <manfred@colorfullife.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Looks good, FWIW
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.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;
> _
> 

  reply	other threads:[~2018-03-21 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 17:25 [PATCH] mm/hugetlb: prevent hugetlb VMA to be misaligned Laurent Dufour
2018-03-20 21:26 ` Mike Kravetz
2018-03-20 21:35   ` Mike Kravetz
2018-03-21  8:20     ` Laurent Dufour
2018-03-21  8:41     ` Michal Hocko
2018-03-21 16:13     ` [PATCH v2] shm: add split function to shm_vm_ops Mike Kravetz
2018-03-21 18:42       ` Dan Williams
2018-03-21 20:56       ` Andrew Morton
2018-03-21 22:53         ` Mike Kravetz [this message]
2018-03-21  8:18   ` [PATCH] mm/hugetlb: prevent hugetlb VMA to be misaligned Laurent Dufour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=051fa302-f4c2-cc90-7a12-eaedfa806e73@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH v2] shm: add split function to shm_vm_ops' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).