Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1957272lqm; Fri, 3 May 2024 11:04:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuk2T0ABYfae6YUlquIRTAc5YOPG4jzTiRequ9zZSQhsyC9C/UG2UGtOZUB1O9qMJvejh6L0+4FUPPJLpmQDCJshh4UHep/k5YQzPTNg== X-Google-Smtp-Source: AGHT+IH7TO5P1sNTyUm3gvUjQ+u6aOH52LrnQPLUs0CYYVznkdSu9p6OEWImQ70k+S2MQ7L93Fw8 X-Received: by 2002:a50:d657:0:b0:572:a6e9:58ca with SMTP id c23-20020a50d657000000b00572a6e958camr2077742edj.10.1714759443455; Fri, 03 May 2024 11:04:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714759443; cv=pass; d=google.com; s=arc-20160816; b=uB+7DjgJyEcGQMZ5IWI9FpwswohxdNkNCfGYVAoqhX7ufMJOapnQOdrxYORjkEJpsk fTNvEHhxCjnYXPULPTL5bNoDjgI4BKxVLZ+MURVxo5u1LQT8RlgnUPfOIF8IkM9QqMb/ vmaOAUfIWumwoC5K0L6pWq1a3P5HwBeQzLdt8Ohm21mAdpExcBrvicQDBLiR69xOOhjA VVS+aUwC9E9/sZCPNdWRxaWrMToyTRWnyRHkzRvzMT7CfM3Ht5C2kunxfYI6U/aQxhsb Xgd+SnOsA6Tn2FD0vRZmI2cO/gJV1NwAgmIN0brkfr/uqtc4PWcgcOv9+68/PF2uQz0R jTLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jLKc0Kyg0qCIKb/rDoPKNEd4XwOknPDg1FlF0nL4bxQ=; fh=9H4z7/o7y4OLn0xLmjdSk9Pth53+ED/R+iGnGlnIr7g=; b=zaozWC4sbD7ewMBsEMEdvmAVp9vHWD9ERvwdqs/PFQM/7+iZ5bPj8LQK2D0wjyn3X9 sBehngdDkpJX61zXClbbAQ+2PE8m/jNwnOk/RewNjhFVJVQLfRI3jsfVAPWi5JgA+yCw U/4PIIMXkT3r3MV6W95vSOgbUvdOZdEBTwWFcSKt5VWNeLXBFP356nIcoTvcb0OhGdlp QU7XuJ00mpiSJn6Flg20iwneEAp8bURsjYfsXjtNMYbZWNfYQfoPLSHyI/8hGSBTThvh KYRjus3/LEXSnPnZpyYkI7h1TRsYEUzkRHUwChUyZg6hJHbxKjkUORyLLHWeE/Hw+J6F hAxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ozf53p/Y"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u9-20020aa7d889000000b00572bd0c0951si1651630edq.388.2024.05.03.11.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ozf53p/Y"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 31BF21F229B0 for ; Fri, 3 May 2024 18:04:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91E8715887C; Fri, 3 May 2024 18:03:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ozf53p/Y" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AB092158844; Fri, 3 May 2024 18:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; cv=none; b=YTwwksw5Svbdx8exFcHytXV7GAVFP2SAOKJ5mpONFR1oVWg6ANpurOBk2QYk7DlKqZE4/c97RzeE4VteJlNSsa0ficx2XZEyNGWbsUq9l5fgFL6skOc2jy6aHXqRHXLv+5LRWX1vUtnQxxFRyjHwEcYEwQy4nrUuV5sMQ3Xj/u0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; c=relaxed/simple; bh=BxWQ3nfJ8G0tvTTltgrGE2Vi8fVZjZKQ8RTpaGZaaWo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tXu4t4ddHO/v1zGTnBY3yrkE+DtWAlNzQRLPjSackYKpO+NfNP75LAN4DmlRaoUI3hI7krBaSj7MgTdI0l0UaFM3MYoSO3xnBl7PsL64pIV5PgO7zKugsJQ9WUZNV2+MYuxpWpcb2bTjG6jKezBq19ekxrAe6+ob3fxVYgCspiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ozf53p/Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E110DC4AF1C; Fri, 3 May 2024 18:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759403; bh=BxWQ3nfJ8G0tvTTltgrGE2Vi8fVZjZKQ8RTpaGZaaWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozf53p/YJ8O1q9ETgyXzeTGjW/yQlxn6NO1VcwwlyB5fhh79Z/RU1DvDX94tKHXJu NsxMbG/hnGuFZpLqegru2su4C38GCd4GeW5Quns/i/+qP9o6be8FGs4t0BGVZB55Mn 9trnxuoEJq8oeqtK7BMePrWszC+NOztLCzuHG46t7ldbbHESDRT9Dwmltq/TaZ3Y/M BE5CX1uGYcY9suy8F8PdvDWsy+Fw6WJNRGelV/7dsjeVyxYEannjrjzGitWrtL5jjT CRis0hFCHlOrM/BpzLuYChhdkNGITy96Kn3Z0ap8peht+EgMJDHn63ctEz1Q+oWGKr U+M1NpLfXp42A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/10] selftests/damon/_damon_sysfs: check errors from nr_schemes file reads Date: Fri, 3 May 2024 11:03:10 -0700 Message-Id: <20240503180318.72798-3-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DAMON context staging method in _damon_sysfs.py is not checking the returned error from nr_schemes file read. Check it. Fixes: f5f0e5a2bef9 ("selftests/damon/_damon_sysfs: implement kdamonds start function") Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py index f80fdcef507c..fffa74a78bd7 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -341,6 +341,8 @@ class DamonCtx: nr_schemes_file = os.path.join( self.sysfs_dir(), 'schemes', 'nr_schemes') content, err = read_file(nr_schemes_file) + if err is not None: + return err if int(content) != len(self.schemes): err = write_file(nr_schemes_file, '%d' % len(self.schemes)) if err != None: -- 2.39.2