Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7342682rwi; Mon, 24 Oct 2022 13:15:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nJNmPxLIhV0L3aTpiLh6Y5I/m2hTAFDw4/o950SIwAukf0/Xx+5/FnJVHZj/u1CiUBMGq X-Received: by 2002:a05:6402:450c:b0:443:6279:774f with SMTP id ez12-20020a056402450c00b004436279774fmr33120065edb.11.1666642537601; Mon, 24 Oct 2022 13:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666642537; cv=none; d=google.com; s=arc-20160816; b=NiKfm6lR6npVKBFMuG3yklQ7m+VP/ifUnQ8ylssfTxBoqqBFGe++14tRIou2NmaRJ3 11zEu2nzFanO36CW9mua+xPys1XqZt0Su81uU2LGchrnmiY8oViCbnAJT8FAdeqEtvPZ B5lHDyTx8IA3ibLIXJVIHL+YF0ykDPvzJB/fDyXw+EiFoCHtzrKFRQ361z6rCR6KGMQg 8o2yQQRsw6QQ2/ymbu2rtHcoykSt1u60FkUi+k4r8mJefpZtQvnhqSYF3l/T8cTL7GdR xsE4nWkYmeMwRvfpf87LG25PuN3Ix1O/QnWLRWJPC5UEuHa1u9IbiM5lYJ2KFWQL4XIO SHMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=iRzKfRmrblnsyJdGRiUYKhbp/UZezO6TzRKVJ+GWMvgySmvewV85h9elOdGRr62LHy T0psxfhOT7uGdxIHgJgTxXQoh5cO4BA4OuB9t4QGrmixf+96KJj7MwKNOVeEern/moBK pYthMBuzAE9CTgAYfFTHwLYFP+GGS3aQ3TqBS16KbjT1BKwUnemZguI/WaUCK3Y682nZ srJyrkhz3PZvEcWT6ssY0nCFZr3nae9ChxM+fMZaxJIz6+E7381+6Pm2nPkvu4l2iH8p heEVPTxalVsFB2wW6KKl6Vyz3DX+L31LyU5x3BwAsWQhAt4qv9f1XgtseH7/wxYCJwoT KxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bGBaY2g3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di10-20020a170906730a00b0078db3556bddsi580889ejc.804.2022.10.24.13.15.11; Mon, 24 Oct 2022 13:15:37 -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=@gmail.com header.s=20210112 header.b=bGBaY2g3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbiJXUCS (ORCPT + 99 others); Mon, 24 Oct 2022 16:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232257AbiJXUBS (ORCPT ); Mon, 24 Oct 2022 16:01:18 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B772324E410 for ; Mon, 24 Oct 2022 11:22:51 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id bs21so1613822wrb.4 for ; Mon, 24 Oct 2022 11:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=bGBaY2g3DIx/8hN0JHcD0TSN7Cpg0DthUSR9UhTbI2bCgNeTHiMw6mcP0Y+qmezrXx oVhpnBDu7LPbNPgQDkEoau1+okRNRNBSvdRInQrBleUZ/rlVAEBAxMeuwIMsA2WiyooH c+jwwWtZTdq/Z6kh2GP5lPoNiRku3hx1+gkKo5vkQgUSwhtzNIwCq3fRecW3BvfG4v3V ui5JcfOo0f3c9au75ma9f2rZqthRhTqUaVI8ca6ODWd0sMgYbvsJ2wej/aaf0oxQSOgs BYJDEIqoUcI/e3t4dgxdCC9Yumymc2Dw7VHTaqMEfn/13Axv/+dHEWogGDaV0MN/nbwd +Jdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=N9K+Dx4EqS9RV2HeH+p4cUtC863I60ElFZR927UMJQvo3p+h8S+PVRFLDWEzaizona FgkHJHw1v2ew4abnXsdZ0APqj4mlmxJh95k4fpra4/7cilHPLf6KmT1GR0HU2Im+8DJa hIPmdsj74sOtHDf8NbBlPr8XbuFV7DvrrMzmgtvfISxzw47IFiv3Naaq1IOPxN6KLwhW nUF2oI8vxTzJZOD+to1fIm8rJbIALvbzj5QDN1y1CIH1C1Sq296GVtzWk0fttM3/I5iR TfIFfuhaHv30cpwG+QTl9wl59MTEcFi/qk+JKhldEk0TAt3gG8jgBbpE9PYSyAXPrZ1d 6vyQ== X-Gm-Message-State: ACrzQf2fS4CWAiJtjyladljxTE45Kgcg1/pOFW8O6THPos3qxVvkXVrI iX0QLgrd4UFXm5BHcnp64VnwbLhiMA== X-Received: by 2002:adf:f4ce:0:b0:236:6578:48b2 with SMTP id h14-20020adff4ce000000b00236657848b2mr7343482wrp.181.1666634891401; Mon, 24 Oct 2022 11:08:11 -0700 (PDT) Received: from p183 ([46.53.250.110]) by smtp.gmail.com with ESMTPSA id h6-20020adfa4c6000000b002206203ed3dsm330262wrb.29.2022.10.24.11.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 11:08:10 -0700 (PDT) Date: Mon, 24 Oct 2022 21:08:09 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] proc: fixup uptime test Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 syscall(3) returns -1 and sets errno on error, unlike "syscall" instruction. Systems which have <= 32/64 CPUs are unaffected. Test won't bounce to all CPUs before completing if there are more of them. Fixes: 1f5bd0547654 ("proc: selftests: test /proc/uptime") Signed-off-by: Alexey Dobriyan --- tools/testing/selftests/proc/proc-uptime-002.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/proc/proc-uptime-002.c +++ b/tools/testing/selftests/proc/proc-uptime-002.c @@ -17,6 +17,7 @@ // while shifting across CPUs. #undef NDEBUG #include +#include #include #include #include @@ -54,7 +55,7 @@ int main(void) len += sizeof(unsigned long); free(m); m = malloc(len); - } while (sys_sched_getaffinity(0, len, m) == -EINVAL); + } while (sys_sched_getaffinity(0, len, m) == -1 && errno == EINVAL); fd = open("/proc/uptime", O_RDONLY); assert(fd >= 0);