Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4350389pxb; Tue, 10 Nov 2020 14:18:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaJ6uAnVW2vXGd5PulfhEcTJvDShV0tEU/ThQ3j54OeiTeWBPrvuvhvZZgls1rHi9RuZHK X-Received: by 2002:a05:6402:783:: with SMTP id d3mr23774666edy.168.1605046706056; Tue, 10 Nov 2020 14:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605046706; cv=none; d=google.com; s=arc-20160816; b=Wa45iVRe4ohT5GG2lSatvBIoCHhkb45JTAC66wbrtgk4LnVrvXk/pTQwaUDjOZ+Eqe eNgrhHasXvwzAmZI+HIKCZ+OgUh6oRwbkZNAsfF9MorPSgYIYcgvM9TBfVRD7pWAjL1q D5gXfVGOPdFdL/N6ZVf/Nkzn6tOtg7qtLzzwsG8CQEe3MwjUpUrOfs/M1ZBJorZGWAIr hx56IDlRHfYYrXbAOcx/jeZ/QjkZ4nH77M9uTdPwWi8IA3UX8DajZZZKGZat27MrlQOB mVfIa3sXpsQhAe5lJiEEr/GUga+4CCOTnabxizPFQljbs1BtBLFLg0Zjuja9oS2LhCh0 CZqA== 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=9r8Sb8WnPfDcu9PaF/bRLIXbVzvj7W4rI2y9M7AptxM=; b=Dtd6mcvlRRLkY0WyZ/dSSROtxwjohpGlN2IkzviRstxVLooFhx3+EFsJH7X+iGuuTW 7AXEdGmVOGNhPauKHY5axPk/BitqQ1rOtX6BI65Ez/5wJjSfel8WGjM1vyw9ixeVttYf ueQDv7ylVZVEBPcNPYNSDtx3HuBKoO+nFuSJ3yMlemtRWRJMPb9UFrdbDaLoTdwzx4FS hYrEGQeIvxsp4P7u7EwDOBW73ssBLPuDFbOk9JKXMXz+C9ZGqeIcyU3jCrvwWShD7dGd nbek0sMyYG6oHnC5TVDwnS9FmRnQedJ4ojYWvkctUHLYmtSnXOzJ8YMIvABPRjFV0fxW Jokw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=RrCBk9gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dx26si9501454ejb.593.2020.11.10.14.18.02; Tue, 10 Nov 2020 14:18:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=RrCBk9gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1732322AbgKJWPT (ORCPT + 99 others); Tue, 10 Nov 2020 17:15:19 -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-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