From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35EBAC4742C for ; Tue, 10 Nov 2020 22:15:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2C4720674 for ; Tue, 10 Nov 2020 22:15:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RrCBk9gs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732457AbgKJWPU (ORCPT ); Tue, 10 Nov 2020 17:15:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731997AbgKJWPR (ORCPT ); Tue, 10 Nov 2020 17:15:17 -0500 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6DEEC0613D1 for ; Tue, 10 Nov 2020 14:15:17 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id t8so72975iov.8 for ; Tue, 10 Nov 2020 14:15:17 -0800 (PST) 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=9r8Sb8WnPfDcu9PaF/bRLIXbVzvj7W4rI2y9M7AptxM=; b=RrCBk9gsYkgr4JGLD6//ysw/HkF6S5XevjEJzSiAPBM4bV7HRdxDtnXyE1YXmdlCgW NVSFhVGp5HoErmIbuSCxrvnF1kDYBtvvdLApWub/k8nttHHdwsVuC82+TeCKnmWtVjaS R3bnVp5GkzTTU8WSXf1sUIip2Urh2wNNVQYAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=9r8Sb8WnPfDcu9PaF/bRLIXbVzvj7W4rI2y9M7AptxM=; b=uRJ9+NBuCvFollAzlI+zMQ/zbuvdL7Ct43QK5zhoLmHXyu2mM9ppofDlAQoUtcn7G1 vIkzModd8E3jj5Md/y/GY0Vr6JTx4DpmqpZapaiSVQAicmKf3AoUXOtIizo2tARoJJIV pZJ1SlK4XxJYVH1TykkkoS/1x0RgbWP8HRptWEbzwa9Z5rRtUThWQtH80GH2isYWEv6g lyh7zrvijzv9CitNVs+h0rC3cAkfoIRoI9IZUSP4DbIAYOX/rSox1UQYhVhkJVdIdsKk DNoMYEUqhQczn5J0xGMF+UdDNFh2GPgGW12qUBOtgYQ+Q0y66nF0rMd8ygQYBmvQWFe+ Lo7w== X-Gm-Message-State: AOAM533ICrU6guVAOrRpGd1wtg9dww4WpwLyXe1OITVVcBbT6BhXV4km ipw1d7WmYhF8sctBIQ2RmD9H3Q== X-Google-Smtp-Source: ABdhPJyEeSW5eq/cht4GvdXndbRqSbau8R3yhklWo1EXdqkKeWKwhm6496TtKrnClymgAXAJGzaQyA== X-Received: by 2002:a5d:9042:: with SMTP id v2mr14195459ioq.98.1605046517070; Tue, 10 Nov 2020 14:15:17 -0800 (PST) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id y19sm8754ilk.79.2020.11.10.14.15.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 14:15:16 -0800 (PST) Subject: Re: [PATCH V2] selftests/cgroup: Fix build on older distros To: Sachin Sant , Michael Ellerman , linux-kselftest@vger.kernel.org Cc: christian@brauner.io, linux-kernel@vger.kernel.org, keescook@chromium.org, Shuah Khan References: <160464840151.97255.15344214064240834294.sendpatchset@MacBook-Pro.local> From: Shuah Khan Message-ID: <50cb30c4-8e8d-7ba0-d429-3f1da4ad1f0b@linuxfoundation.org> Date: Tue, 10 Nov 2020 15:15:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <160464840151.97255.15344214064240834294.sendpatchset@MacBook-Pro.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/6/20 12:40 AM, Sachin Sant wrote: > On older distros struct clone_args does not have a cgroup member, > leading to build errors: > > cgroup_util.c: In function 'clone_into_cgroup': > cgroup_util.c:343:4: error: 'struct clone_args' has no member named 'cgroup' > cgroup_util.c:346:33: error: invalid application of 'sizeof' to incomplete > type 'struct clone_args' > > But the selftests already have a locally defined version of the > structure which is up to date, called __clone_args. > > So use __clone_args which fixes the error. > > Signed-off-by: Michael Ellerman > Signed-off-by: Sachin Sant > > Acked-by: Christian Brauner > --- > > V2: Replace all instances of clone_args by __clone_args > --- > > diff --git a/a/tools/testing/selftests/cgroup/cgroup_util.c b/b/tools/testing/selftests/cgroup/cgroup_util.c > index 05853b0..0270146 100644 > --- a/a/tools/testing/selftests/cgroup/cgroup_util.c > +++ b/b/tools/testing/selftests/cgroup/cgroup_util.c > @@ -337,13 +337,13 @@ pid_t clone_into_cgroup(int cgroup_fd) > #ifdef CLONE_ARGS_SIZE_VER2 > pid_t pid; > > - struct clone_args args = { > + struct __clone_args args = { > .flags = CLONE_INTO_CGROUP, > .exit_signal = SIGCHLD, > .cgroup = cgroup_fd, > }; > > - pid = sys_clone3(&args, sizeof(struct clone_args)); > + pid = sys_clone3(&args, sizeof(struct __clone_args)); > /* > * Verify that this is a genuine test failure: > * ENOSYS -> clone3() not available > Not sure how you generated the patch. I had to use git am -p2 Applied to linux-kselftest next - please make sure to generate from top level. thanks, -- Shuah