From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756839AbdCUIjW (ORCPT ); Tue, 21 Mar 2017 04:39:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53534 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753601AbdCUIjU (ORCPT ); Tue, 21 Mar 2017 04:39:20 -0400 From: "Aneesh Kumar K.V" To: Laurent Dufour , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, bsingharora@gmail.com, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] powerpc/mm: move mmap_sem unlock up from do_sigbus In-Reply-To: <925b1b5f2d28b5015354405af72bf23d21a1c5c4.1487090656.git.ldufour@linux.vnet.ibm.com> References: <925b1b5f2d28b5015354405af72bf23d21a1c5c4.1487090656.git.ldufour@linux.vnet.ibm.com> Date: Tue, 21 Mar 2017 14:09:06 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable x-cbid: 17032108-7323-0000-0000-000000DD53DE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032108-7324-0000-0000-000002826853 Message-Id: <87a88fowgl.fsf@skywalker.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-21_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703210078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Laurent Dufour writes: > Move mmap_sem releasing in the do_sigbus()'s unique caller : mm_fault_error() > > No functional changes. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Laurent Dufour > --- > arch/powerpc/mm/fault.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c > index 62a50d6d1053..ee09604bbe12 100644 > --- a/arch/powerpc/mm/fault.c > +++ b/arch/powerpc/mm/fault.c > @@ -119,8 +119,6 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address, > siginfo_t info; > unsigned int lsb = 0; > > - up_read(¤t->mm->mmap_sem); > - > if (!user_mode(regs)) > return MM_FAULT_ERR(SIGBUS); > > @@ -184,8 +182,10 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) > return MM_FAULT_RETURN; > } > > - if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) > + if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { > + up_read(¤t->mm->mmap_sem); > return do_sigbus(regs, addr, fault); > + } > > /* We don't understand the fault code, this is fatal */ > BUG(); > -- > 2.7.4