From patchwork Tue Aug 22 01:54:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 13360076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DA40EE49AE for ; Tue, 22 Aug 2023 01:55:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40CA7940022; Mon, 21 Aug 2023 21:55:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 390B4940021; Mon, 21 Aug 2023 21:55:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BFEF940022; Mon, 21 Aug 2023 21:55:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E5E8D940008 for ; Mon, 21 Aug 2023 21:55:26 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C22DCA012D for ; Tue, 22 Aug 2023 01:55:26 +0000 (UTC) X-FDA: 81150073452.01.3A90964 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by imf22.hostedemail.com (Postfix) with ESMTP id 059F3C0009 for ; Tue, 22 Aug 2023 01:55:23 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=joelfernandes.org header.s=google header.b=dfaWwvA9; dmarc=none; spf=pass (imf22.hostedemail.com: domain of joel@joelfernandes.org designates 209.85.166.172 as permitted sender) smtp.mailfrom=joel@joelfernandes.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692669324; a=rsa-sha256; cv=none; b=L1ESy+SORWbAlmqpKMMX5/CXAzU3X48z/sariJmCKd5ZU45elQ07rx/MFWU+0axnqxvOPp 8Z5priceYWWb+LoQLJAAF/BhzOMydKzJRlgAzMlGnC182eMAui6XkoOd2MjOwZ4vW29hDq tfFw247VBxn1gB8Xi1QykZ0JvKGk6VU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=joelfernandes.org header.s=google header.b=dfaWwvA9; dmarc=none; spf=pass (imf22.hostedemail.com: domain of joel@joelfernandes.org designates 209.85.166.172 as permitted sender) smtp.mailfrom=joel@joelfernandes.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692669324; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7MVDg4AiFSlG/+H1Z+4rrwZ5TuiaCol/qVRe1MkiyJ4=; b=HWxTjzoUoKzDhcTLjAUbNAjigJk88z/OE1lWRYac1sm64HwZyz5SJZiD0Ij7Ke3bSXxc5h F4QYwUC8VvCc27lFvgt/slpW4GBDYPcZ8zxIp352aiSH14LFnHZpAGwZfgU0/WOM9tR8sL JXKcFwDIav7kdWWJo36kBfJeW1SXyRc= Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-34ca07ea55dso8942825ab.2 for ; Mon, 21 Aug 2023 18:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1692669323; x=1693274123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7MVDg4AiFSlG/+H1Z+4rrwZ5TuiaCol/qVRe1MkiyJ4=; b=dfaWwvA9oBL1IZ1Ld8nmBYZfchopf8juXDP2xXzgSG1+4P+Y22COL076a6tOgVMiwz QILZngUNHyArlcv/oP21Fea28QqZgLAOBnLUlGNmpK8m4daK64fIorApmoM/BsiyrFBx m5xcXJdKn0E99mRIBpuKTVuUQA71ez3oXSMYA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692669323; x=1693274123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7MVDg4AiFSlG/+H1Z+4rrwZ5TuiaCol/qVRe1MkiyJ4=; b=kroo0AP27X+lZMBiaVrujMRV+R8aH26Oe35sfLn9KQ7qsjbsf7rf9WAjGlvmN1dTrM /8PDudX2v40+wMSp9mUz/28CGp6YVtoGpxLwXK4YbrPqgC+AfIsHMH4t8C8sdR28TBsb s+h4Z0/3s9G05oDw/YC6aJJp1HfVx5fm9H+b8JnIjcTkVB8RNOKh72uU2fbWJ64pkQsa Q7+OJSnSkBXtWgScQ8FJU0z6dnx+HB81/2LVdySGphPRyp4PtqjBvzwDAcx/M8G3/ET/ tS6yYBYoy3t/XxcvdtnWbn8DcUk1qM5qfn0bqrANNQ04/HozyDNs3aL6lSYVKZT/oMoT 5VYQ== X-Gm-Message-State: AOJu0YzW5d9UThv5vkkM/BM2QPynlsOyY7mmFdoXjZpDY+3RAHQxirsG rwy7OOaSR3/S1D/nC5meuU52xg== X-Google-Smtp-Source: AGHT+IHvqVdYTC6n4DObVG1/cE1N4x7Ela2mYdMwjClLo2WnnHgsjk7IpjhEewtQDpWgbd40PsHlhw== X-Received: by 2002:a05:6e02:1906:b0:345:b923:971b with SMTP id w6-20020a056e02190600b00345b923971bmr12162039ilu.3.1692669323174; Mon, 21 Aug 2023 18:55:23 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (156.190.123.34.bc.googleusercontent.com. [34.123.190.156]) by smtp.gmail.com with ESMTPSA id q11-20020a92d40b000000b0034886587bdcsm2907390ilm.18.2023.08.21.18.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 18:55:22 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Shuah Khan , Vlastimil Babka , Michal Hocko , Linus Torvalds , Lorenzo Stoakes , Kirill A Shutemov , "Liam R. Howlett" , "Paul E. McKenney" , Suren Baghdasaryan , Kalesh Singh , Lokesh Gidra Subject: [PATCH v5 3/7] selftests: mm: Fix failure case when new remap region was not found Date: Tue, 22 Aug 2023 01:54:56 +0000 Message-ID: <20230822015501.791637-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822015501.791637-1-joel@joelfernandes.org> References: <20230822015501.791637-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 059F3C0009 X-Stat-Signature: xbonnyt73gnsdwuufyd6yih8chbgqucw X-HE-Tag: 1692669323-617008 X-HE-Meta: U2FsdGVkX18P1bCFIfq7p9ks2wzuzXxB5sxHJBLnasesamuRr8Vt8Of3R9JRBQELD2SrBrkJ9ZH+D2YXt30rl1fYdiKkMaPL8CCqpBSV8zjMIS4rML1HJcz01MdLjlsf7PEOis6ZpnErl85bdP4ysvv67lpUR4zUqTTyKI5RNqYp85NSTu2j7lBVaXUBeYomsRq5rqBiSUCVd92uZIvD+zlOYuRXAIAKucDnxmW5yBjO5z3J+kNKMV/SrDDVi/fSHrMQ20Gpcx7YN0OSvGNCH6ifTs7aNPdkPQe/8/2ZZQqg1kI7OrQ1JyLIdkwyqJoJopuI8JVa0z62cqC5DLcqncM//dxJj+Tj3iQAadLCAfAwMelVLOxzvLrZHdvg5ix1lW0Ngy4oQ6HXSyFAvOORQgKj6d/R+L1cIeG1FtUMMqXgGabhoVKPjVDPaG0pbx624/nbuuve2CZSBPgweslqXBg1KPT3aOGfgQQDaFdqPrSUxVGeAJmRhmqxPhYg898j6u3z1yJntj+ldwEG0zFeaUGBrsuCX0n9lNSDF4WhgsTGIIdxLdVaScTj9Cy8bFkaJtjKbpj4aMD+316RoU8RmsUEfCSDlfRJZcGNAUwH0bO18WT9DapegrsvNW9ELCg3yhQIo5puBfeA7Xlv1dunYxsk/A4n2aDDc9krU7/Pa78ev140fMfFTn1YALyQzFuhYYct7lFvYlVjVcxJ+PhrniXe2OsuHtM4e/1wScYTuMJrQPLt44hfKUbVgBqGwjMRbYs1JPVMFqG8SptDOEG19WNUr3FPbYGuP7eQbBfLkneew7p+RoFOPgiQsprlGifIyFBo9Qk9An6Ymvu0jqJ/A1BUn9jkgjnP3uD1SssTjJNwE/ej58uHeod8cIlbDcdE2RzxksZrRqBjimFlcSjhdG2qrnv6HoCG6D+qwlHzoFhgR5J27T6Ku5TTuvmUL4fRL0sQcv7mxIyVOCXcGdi fKb3S0rb 94p87rB1SUAPx+w+2CDbC0ShtMZVyCgickNsb3dS9aRrAJGJnO2ZnPCRLjlwDFvPl5Gobp6I6pkSHkyfWLb8RHZN2zX1pMI9KWkaG+F366YNHcU8D1EJ+fKc1Eusu+StoV8rLe5MZpUQ5TZbFKXFpUvIKJP9f++wFrPSyQ6rJPT1mr7BIBx2IgUKueyvchBQxGhGaWAYmWbW33ga257FgFdjY1Hbw7TM0WzppThOsnoZOZa7uTYhon+kt1hdKy87t8d6I2uHpLOKZ5vmxGtwjAHVTPjCMBXBu/lNy8TRzxdZOHM9Z3Kxlh61XMrtUhKNW1nkUbd5oU1Z7bKm+mAwDPvROepwDnw1kkl7F+flN21sZZAaGdhgeHSsVx/ZgDGE4lsJE8iKmf/vIjr530gg6ZhuWK+bPITLiPQjf/uPmrnrB3eA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When a valid remap region could not be found, the source mapping is not cleaned up. Fix the goto statement such that the clean up happens. Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes --- tools/testing/selftests/mm/mremap_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5c3773de9f0f..6822d657f589 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -316,7 +316,7 @@ static long long remap_region(struct config c, unsigned int threshold_mb, if (addr + c.dest_alignment < addr) { ksft_print_msg("Couldn't find a valid region to remap to\n"); ret = -1; - goto out; + goto clean_up_src; } addr += c.dest_alignment; }