From nobody Tue Nov 26 19:59:16 2024 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A6FF18BC33 for ; Wed, 16 Oct 2024 20:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729109887; cv=fail; b=qV4Pueyt8x6vB6IASuNUPYUXVpU3GtkJ/SWuxuW6laqHi1j5rTHoy+HbcYPBnPGpcGXc1d6YI8S1gAGZdshIS9PcvIiOAy8Qrq8yyJvXBE+egm8tlyXCDF3Xw1TOMbVXhQV2SHUHCZhMF3G0sfAlyoh91D2+YaRDrsvJ2ySo/eg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729109887; c=relaxed/simple; bh=OvXEBcy/b3GPKLiqHpgGHA2d7xthMcaKeANfiU65Szs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=eGXmbrg7sOiYFAWw7T6/l4cO75nFyhMhUtUkPahvxrSDlleECAB7ZA7uJ4DAxUvY7rJgXG6CjOFWkIl1f7qUotvlbUqjYLx1m1zqPdRPZYVKpKd+mw8gUtxF9hCt8nhYBJuaf+21gQYaqwaHto3Bji1E5NrXqJ+gnvcy+gnt6iQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=YGvzQ+Qj; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Boo0BOIU; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="YGvzQ+Qj"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Boo0BOIU" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49GHtfTB027341; Wed, 16 Oct 2024 20:17:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=l3FXzpj5Oxzaq/uDBOwGSH/4JCCCag4pwr8pw0P2YRg=; b= YGvzQ+QjaYhVP6gOYCI4hjPpylG93N2bIT0KaNNxr3/P8wohZzroNAFTwxSHW4mY 1ce+SR2ZioIER7vV7AVd4qccrGXC6/7469dOe213bEv0jZAsCi1mNNC/VITNjwJl MqvRGSaOXLtZ6KVvsH9OQwHYgI71VUc85m0xg3HhT+CaVX/pxoKUEpSWNh6oRke6 +SmAklVXexJppAR6P2iopqKKF4K+PLwBPh+WgG1coMa53CL/foxYMn6YWF+uq5x4 /SvMxU5c2OgskRrk37NyyBvauC5AfdhmfZ0kHlDOjyJcET7/A7zmhd8n14Cjnkwo WHGH1hPx0Td7lSKkTnXR0A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 427gqt4snw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 20:17:44 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49GJQOOv027123; Wed, 16 Oct 2024 20:17:43 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 427fjfwk05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 20:17:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ePcuh1GPiDAXISjLGRWYrD8B6UVMGoRYwBUt8cL0zCcGMbdphib11J6bVdZOGFU5aomrR3HOq4grLXAbvaQ85/I9U+9ELhd/QKVKaF+xEtGuuHyXwF28FkTx2th+OgOB/GWjLFTYgWf8ojvzNYi0HUm7eLIJwdgpCNxKRY187+pw+nVtrVaSsdNd007RL7pRjkQDMW9WtseV+9zdnseHzipFdaXLrXq71KmOdVWHRwMIEgL/ZbrTqL55zETUaY12Brc7blGOqbfzC5ck8Zeaj9WCvSkJ3QEcXbvABLHxZDgSyPva1FwD0t89lB5c84QTNrhtbEocGQVY2X7uVSyyLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l3FXzpj5Oxzaq/uDBOwGSH/4JCCCag4pwr8pw0P2YRg=; b=zVZUvjqOnfic66nHNeIpnFk3grjVay3OTlDvvNxQGKGvBqRQD89IttVDGOBVFpy2BQLzFSwf+KXbH24CcagJM8L/1eR5SPbCe7BgciYOCCwBfbe0/sKdXPFsjdioLTSS8ZCU4qdmLqEWya0Z92k+mkRNMeFLdZwyjcRytIB4qjPlTOG1K5EbRnalCI5D1nAJ1/vyHKYGCHDWXqbGLz8em0az1Ev4bSD4/iwgp5W/X4MJIOnEFg8d3D3RKTUI9VLeRN9VFJd4Zfiu37HgswHPELd+jWoMVboKuCrL16qIp5Yn7Jba9NfAs/OcoSsARTg44KMfGAWsoJYMJPUoJNV65A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l3FXzpj5Oxzaq/uDBOwGSH/4JCCCag4pwr8pw0P2YRg=; b=Boo0BOIUEP5edjKt/OydlNtMvYckk/ro6868BsDwcj7YUfBPIoZCOu7AJ574utZ1hthbeR5rNJ7H3XYat4Y8WxOR8NfnxsomkDVpV2TGcmzo3izz4cvD4H4Djn84en0Vhpn/D7GoQd9u7yBXphFFCWVMdjHuE7oNyOqf8xsEd4k= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA0PR10MB7579.namprd10.prod.outlook.com (2603:10b6:208:493::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Wed, 16 Oct 2024 20:17:41 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%7]) with mapi id 15.20.8069.016; Wed, 16 Oct 2024 20:17:41 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Lorenzo Stoakes , Jann Horn , David Hildenbrand , Qi Zheng , Kefeng Wang , Jeff Xu , Pedro Falcato , "Liam R. Howlett" Subject: [PATCH 2/2] mm/mremap: Remove goto from mremap_to() Date: Wed, 16 Oct 2024 16:17:18 -0400 Message-ID: <20241016201719.2449143-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241016201719.2449143-1-Liam.Howlett@oracle.com> References: <20241016201719.2449143-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: YTBP288CA0006.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:14::19) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA0PR10MB7579:EE_ X-MS-Office365-Filtering-Correlation-Id: b0b512ee-24ed-4995-e0f1-08dcee1f9652 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?H/5ooc7ENFAPaGsVkUHYMhkXRAe3zuW6H/76Le9wwPcWBcZA0eGup7uTjpp+?= =?us-ascii?Q?tVWTpHWrOvsq3YSVhOKW5o6gssjQs9wE3Fx3wp2MHUjawBl1YGUwZcE4D+cs?= =?us-ascii?Q?Unmj5+PXM0CE6iLal1FyuxGxzIoO49BIbfebQ3grE3EaQ5/JmtxUme+noFFD?= =?us-ascii?Q?h8MrbQPUSe/8vGB7XNF3BbV/u9C8PnDvNYMPPzN6Hl2hZbMWpn1ooW68TVdX?= =?us-ascii?Q?rg7khjzasGMXc7vnU601Ups+5i6/9ieRgzvvpXs9xdZy3GpbwjCs95hv1Jeq?= =?us-ascii?Q?Z9xmXtA1fxNXhNyirh1Cxe0vzpGAPF1Qk4PIk+25pgq7T61tksmhIxyNwWak?= =?us-ascii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2IaS6yHVhG/pVp+Rb?= =?us-ascii?Q?yf0ix+fNY5kgl/jRB5TG7ABfX1fJiOcDDXaToUQh/WKhm9yi/ZKR+5SOePyD?= =?us-ascii?Q?OuWbyAtAGZPGJFXLm64OdOR2?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oCq2DE7sdj+r6KqJ3Xzj3nrSe7e/8DeK0eWXSXT9K/m49pKP8WuVuYpmAaI0?= =?us-ascii?Q?nBLxvCI+Ys2hK103GrQsqoi/4WpkLnfyitUxm7Ph+j0d5tNmtZTAP/wOOlow?= =?us-ascii?Q?ImLVF6/bSCEDi+sfzqpJbgE2J29lTF5WEtPp2evp3bBunCrp9QtIl6ilhRcG?= =?us-ascii?Q?+TiXdbavmzaOAPiIeKU4uSu6HE6O6rfQlL2O2QXdY3HwZI1rDRIepplBjcV8?= =?us-ascii?Q?Qm/FwiIBMA/IYcBPeD/0W6IIr7rqvX7t52SlES5vXIh1a/QwArMXFHFvEW6q?= =?us-ascii?Q?jSonvZl65NXuzL55GN5E9v3uePazJ/RHF3vxulHkkrZhxsf3aF9h9ZNAxUMm?= =?us-ascii?Q?5DphnZLODrc1XOLpaw3CpCUs8usKaOz2VxkCRXW7b4faRVsYN9WfCMLVJ1ze?= =?us-ascii?Q?ij8wK3tKHGT7zZvx+G1KcTvIKMCKrgkvE7WdRC8J34sSoaoavP02VGOu0+F5?= =?us-ascii?Q?081X2+t1D7tW/Ds2sFYIZb/rkHV0NSe10gvi+Cm52lqPsykyMzDgtMMn+HZ5?= =?us-ascii?Q?Lf1bRAPzVnc2hDon/ySwDrSQurm0PYYuj5D4bU1+s3VOfIo9w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wRecfYk9trXVW8ysuA7eM5B9WpbJBVGXGH62mO?= =?us-ascii?Q?wLnztpZk0vwErUYO7M0wxHhCfN/7S8WfyyLsNYLQBOosdWN+1XJFpGgM7K4n?= =?us-ascii?Q?zrS2rlW1S4xmQQcDpPrMFDWQioRiGhTob7n2ocv2yHM8n5vFGD7dltUyCz6s?= =?us-ascii?Q?zQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: e4vjIhshNh/Co8yQir3VEnhqoPFFvxx/GQj9chvJza/OOC7+sSgym4iO1YVNCIxgq/RaVtw6UyDC60jbBD6a1Z31h7jjEqno0ZboH13rLl5s6ouFMtyPQnwHHvcBQsliswq3k9TJNQUg9+syYrc9MRTJ/+nuytDHrz+UFhbTVNaSGd0eAaQ4378YVzfL2KsNMFAVjUtpjtZh6oeQ7pUW82yQpZi8lMGuPZj6S6XzloNc6V0+PvvteSBCAfB7zYH0AXm6NhlfZnEhunygMqcP9NPoCjwlERsUIxATo1Hlb2n3WQF5z+bHg45PIjGlesVxn8GdHY4zHL7lFfAvrMilKCjXzdfgrcuwSkOI5jayWlERtodBPF6HavblwiOiKOZAkqboMOMVp/TC/fUaexvkyls4iQBdwf+l9zA+H8ZdIPdgXPqQyK3QoQrE28lE4b7xH9ra2rE38UNQ5TK32qpvGNiRnd60nqWgxsMugQHhaJxDNOiTHH3nNyRLNQDpWqyktIEgFzJkpfIMjXdNtM8dwRgAtaTTn7KfgrCaa5IB3MFifS9HwiTS8+TSvk4OLfm7k0iW3fo7VQxyA+nERtKYQlp3gdNN+GjBG9LVKgemWWg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0b512ee-24ed-4995-e0f1-08dcee1f9652 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 20:17:41.4040 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A/rTvBxze49jguMUuZ9AWCP87yAQMKh+hKnvBrfOxPN9bQCiSgzDxeiW05rwFyZP8LmsTEN5QzQPiLCzyprmsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7579 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-16_16,2024-10-16_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410160128 X-Proofpoint-GUID: WEE5SXNHBXo73NwsSxnWiw2GK66SggP- X-Proofpoint-ORIG-GUID: WEE5SXNHBXo73NwsSxnWiw2GK66SggP- Content-Type: text/plain; charset="utf-8" From: "Liam R. Howlett" mremap_to() has a goto label at the end that doesn't unwind anything. Removing the label makes the code cleaner. Signed-off-by: Liam R. Howlett --- mm/mremap.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/mm/mremap.c b/mm/mremap.c index 648c29f568af..5a1eb3da730d 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -883,18 +883,18 @@ static unsigned long mremap_to(unsigned long addr, un= signed long old_len, { struct mm_struct *mm =3D current->mm; struct vm_area_struct *vma; - unsigned long ret =3D -EINVAL; + unsigned long ret; unsigned long map_flags =3D 0; =20 if (offset_in_page(new_addr)) - goto out; + return -EINVAL; =20 if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len) - goto out; + return -EINVAL; =20 /* Ensure the old/new locations do not overlap */ if (addr + old_len > new_addr && new_addr + new_len > addr) - goto out; + return -EINVAL; =20 /* * move_vma() need us to stay 4 maps below the threshold, otherwise @@ -921,33 +921,28 @@ static unsigned long mremap_to(unsigned long addr, un= signed long old_len, */ ret =3D do_munmap(mm, new_addr, new_len, uf_unmap_early); if (ret) - goto out; + return ret; } =20 if (old_len > new_len) { ret =3D do_munmap(mm, addr+new_len, old_len - new_len, uf_unmap); if (ret) - goto out; + return ret; old_len =3D new_len; } =20 vma =3D vma_lookup(mm, addr); - if (!vma) { - ret =3D -EFAULT; - goto out; - } + if (!vma) + return -EFAULT; =20 - mremap_vma_check(vma, addr, old_len, new_len, flags); - if (IS_ERR(vma)) { - ret =3D PTR_ERR(vma); - goto out; - } + ret =3D mremap_vma_check(vma, addr, old_len, new_len, flags); + if (ret) + return ret; =20 /* MREMAP_DONTUNMAP expands by old_len since old_len =3D=3D new_len */ if (flags & MREMAP_DONTUNMAP && !may_expand_vm(mm, vma->vm_flags, old_len >> PAGE_SHIFT)) { - ret =3D -ENOMEM; - goto out; + return -ENOMEM; } =20 if (flags & MREMAP_FIXED) @@ -960,17 +955,14 @@ static unsigned long mremap_to(unsigned long addr, un= signed long old_len, ((addr - vma->vm_start) >> PAGE_SHIFT), map_flags); if (IS_ERR_VALUE(ret)) - goto out; + return ret; =20 /* We got a new mapping */ if (!(flags & MREMAP_FIXED)) new_addr =3D ret; =20 - ret =3D move_vma(vma, addr, old_len, new_len, new_addr, locked, flags, uf, - uf_unmap); - -out: - return ret; + return move_vma(vma, addr, old_len, new_len, new_addr, locked, flags, + uf, uf_unmap); } =20 static int vma_expandable(struct vm_area_struct *vma, unsigned long delta) --=20 2.43.0