Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp676353pxb; Thu, 31 Mar 2022 14:42:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCi1Fnx/RHutGlOdoqJvtXN9DanEZ/sFx38N9l/4HU/V/vwvJEWhHYK7uVOGMWjUtSBhi5 X-Received: by 2002:a17:907:7d8d:b0:6df:f3a6:b0d9 with SMTP id oz13-20020a1709077d8d00b006dff3a6b0d9mr6861072ejc.13.1648762955068; Thu, 31 Mar 2022 14:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648762955; cv=none; d=google.com; s=arc-20160816; b=ZkBD+Ki5zlcu1pS6SJZB467rlh5oWjlRaa6jTi0pKb88at8sGPbFMqaAbK6IEAgxcG BWIZlDJ1/adnOBkKYBfo6WdW+6Jkj4jr6x56mkjCZa7UZp3FTkIFvacgmBQTMS1SrrQm cO4xDbXhlgnRik1gXbLsROLfIMz3CR/ZNNPhMxn2qCGFtDFrUZy9JFCDAVbxIF7QuhQK 2uK/pxQa71gyoVrcYtUn2c0ihJML5452+irXDv7qMtnuiirEyZx/fCb2z0sp/9+mcMxa Xe+9fRzbzIOWclbdSh+RHoZ2MhGECfeJYFye1scxhgPOcMbEmVGOn8MV1B9hgC0MWvoT wLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=KDv50hCOMSNm4tqOFej1XxVHswnaiqBQ/Ql5PRaAElM=; b=nAEF/SwKNQD68x7eSW+mYofXdCCGv9ijSaPkak5XbxwkuQq17qEMdyUXPM/luZzbhL TrwqsXUy5T8s/ZRY6DfXdoBVw/nHJ34EFq2CP3IZflaCTEtVj8cD/JbsJ0Jouj+YxYyx 7cDYewGE08QzBE1ZznizgVHN9JFlKH4XfPl65re/STlQDJo5CfbKdUa2GQDQa74WSS0m ExHn3QSMgyCsYpRfSo1EpED7AN8cCD0kNVorMJlhhjzsUL6EO4WsiUgB7JiR6gIwmBvW mc7jAxn/i7QikI2ZMJeDdGg6vtjf8dTupMMfIlfu5ltUsw7gFPghEgivhzIr1eZOp1W8 ijDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hr3WMnbN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020a05640251ce00b00418c2b5bea4si596472edd.390.2022.03.31.14.42.09; Thu, 31 Mar 2022 14:42:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hr3WMnbN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240573AbiCaTa3 (ORCPT + 99 others); Thu, 31 Mar 2022 15:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240706AbiCaTaZ (ORCPT ); Thu, 31 Mar 2022 15:30:25 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58043554A6 for ; Thu, 31 Mar 2022 12:28:36 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id 9so703576iou.5 for ; Thu, 31 Mar 2022 12:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KDv50hCOMSNm4tqOFej1XxVHswnaiqBQ/Ql5PRaAElM=; b=hr3WMnbNxfXX92/Y0t14FpEIS4pC+09DAI6p4oWqZgWnX03dIRuX74ev7qupnrKxzX n5Cz8IINdInr4rUCepEci1G0mhVdD9KS789z+ALBCwmklBUAZ+nFdcApJvLiaQ6DE1h6 gsrrPum6Nsrl58HvbzUvPWVrmzlfcNkgPf0Os= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KDv50hCOMSNm4tqOFej1XxVHswnaiqBQ/Ql5PRaAElM=; b=CmjlOW6UXyjWhsoz25m8R7H1RH0TKo0HTYMVgmSOC19G51/hUbsgDsq8Mh3xxTZteO 8KzPFEDVGh+kKcUB82i9MjNJFLz6FIae/Rn5u7sqXq3vKZByyHUHyQjY4SiJk3VurIi2 bv6iFURh2AXWw+Qz8hVYszgYE4TIyWBNGm4an7aEwQU+DULOoYx4JH2uMWhZlilFaNr0 O9f3guIQZ0beWo0xyL4vUWjDL7zHpXHile8iM6/jyQyZYunHhgwq6ALLTjn1Ev5FOW3h cVkvu9IOcE3477LaPhilE79pRGYsfpPrLRX7PAIyVip8jKGl3Fu5T4gw0RYHuoWCpUVx 190A== X-Gm-Message-State: AOAM5339YQpkeoi7uCdRYyjpmuCbj2ca471WZofG0BLrzZXKR53bFA7s zx9Gnzc7DvQVmN3Je6LOx4faFwOTcHKqVg== X-Received: by 2002:a02:7fc9:0:b0:323:6239:cfdb with SMTP id r192-20020a027fc9000000b003236239cfdbmr3849890jac.186.1648754915705; Thu, 31 Mar 2022 12:28:35 -0700 (PDT) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id k12-20020a056e02156c00b002c9ad2b3dc4sm168559ilu.74.2022.03.31.12.28.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 12:28:35 -0700 (PDT) Subject: Re: [PATCH] selftest/vm: clarify error statement in gup_test To: Sidhartha Kumar , shuah@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Shuah Khan References: <20220330215257.112029-1-sidhartha.kumar@oracle.com> From: Shuah Khan Message-ID: <9a752af3-8e3f-bfc5-eb24-eadcaf800bd5@linuxfoundation.org> Date: Thu, 31 Mar 2022 13:28:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220330215257.112029-1-sidhartha.kumar@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/30/22 3:52 PM, Sidhartha Kumar wrote: > Print two possible reasons /sys/kernel/debug/gup_test > cannot be opened to help users of this test diagnose > failures. > Thank you for the patch to improve rather cryptic error messages. > Signed-off-by: Sidhartha Kumar > Cc: stable@vger.kernel.org # 5.15+ > --- > tools/testing/selftests/vm/gup_test.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/vm/gup_test.c b/tools/testing/selftests/vm/gup_test.c > index fe043f67798b0..c496bcefa7a0e 100644 > --- a/tools/testing/selftests/vm/gup_test.c > +++ b/tools/testing/selftests/vm/gup_test.c > @@ -205,7 +205,9 @@ int main(int argc, char **argv) > > gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR); > if (gup_fd == -1) { > - perror("open"); > + perror("failed to open /sys/kernel/debug/gup_test"); > + printf("check if CONFIG_GUP_TEST is enabled in kernel config\n"); > + printf("check if debugfs is mounted at /sys/kernel/debug\n"); Instead of adding 3 messages in a row, please check the errno to figure out why it failed and print an appropriate message. If open fails because CONFIG_GUP_TEST is not enabled, the test should skip the test instead of fail. Failing will indicate a test failure which is not the case. The test couldn't be run due to unmet dependencies. This test requires root access. A check for root privilege and skip the test for the same reason stated above. > exit(1); > } > > Please send v2 with these changes. thanks, -- Shuah