Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp47089pxy; Thu, 29 Apr 2021 23:31:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlRnsH5IiqOGYvdd0sSFbnTm4Czv8TdeUU5BMLjTSmz8ENj/cA0ZoIt63QIwsOcBFIm72+ X-Received: by 2002:a05:6402:12d3:: with SMTP id k19mr3835653edx.52.1619764305788; Thu, 29 Apr 2021 23:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619764305; cv=none; d=google.com; s=arc-20160816; b=gfovZVWe28zWGMZgqThbBFx9U9HofJ9HCBnX557+iY67/eAmEekJM3BDuth9BVPywr idoETHNTcKLEcEGvuXiU5ZZ/IEaZoQJ1Meyc/X47V1pgPw9L7zEFEjzo+BjiTSpWoLQT FyGbvxNa45qD+n4rBPHv89Qh5KGsGpyrljmkolehvQLxNar0+4gOzAwofyCpV0agO3ES +Cb8OGkyQBfCQB01eQs1aERQ7XUWcUqh+qebwKiO30TOBV68Sho3rp9YUS6YylbekOgg gnUvmcgH1Ii5T+L+hZIqpOfZXH5rbrdXqZW/TZa3mjHEszIoHmkFIIcC8lnTPiauqCj7 CaTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8xs0dLpLOjPpVnPASrxUlEldZYCSMQdMwxiE4uRpAVE=; b=PdaQB/z9ZfYCQJ9zEw/DhdSb0OcW9m5wgrmPnQVNgk/EuaQPLWiyYOzpz9RfDaKTTl td+tz2hiAxhY0pnGqsQ/E7ps+cRjD3ryDlcYTSyq7lZnEIJeN1NIdtXsneelahDbcz20 Z/8slFFbvO3hxhbSoc/n7lkDfgDtx2gst7jmDK6HU4X6PycqrGoqlwodUGjQIJ9dQEeK bxQ3KXOCQFtOFcSS64UsWm134Zle4pCL9zsCy/n/AG7DK9q6tZcjTtr1MTWLaWA1hLcb ziXe5BkEyPqrLvv0V+v2JAzOAhJwsio8h4PlL1AH0ptmcDjBcJgV7Z14hQF8lCdMk2YW WV/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pu4dCg8w; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq6si2206264ejb.103.2021.04.29.23.30.57; Thu, 29 Apr 2021 23:31:45 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=pu4dCg8w; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbhD3G1z (ORCPT + 99 others); Fri, 30 Apr 2021 02:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhD3G1z (ORCPT ); Fri, 30 Apr 2021 02:27:55 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FEB8C06174A; Thu, 29 Apr 2021 23:27:07 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id zg3so21958255ejb.8; Thu, 29 Apr 2021 23:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8xs0dLpLOjPpVnPASrxUlEldZYCSMQdMwxiE4uRpAVE=; b=pu4dCg8wMqoLaZPNo8l7m4HVzy2AtSPH3urmWWJi6lxKe3sQB0YkCFA92/ekiD3Nmj H+Gjtagm5Nq99uGgYAbTcrO7Cz3c7uNT+wFofH9KFOR4sUe0QjFWlpMVsyGFts7XfsrT FS5ztKRbjzsA3Nen6RKla4rc5ELSL0ddt5WvwOZPO1m4VD6Sq7sZsqWOWp6aeAhW1YtH ocURZNj2SPULTShaGB9+EgwAADrEjTKdxpK8RBy3Q6zJAiFkW3JYmv9o/AED9yJ97oJT w8U70NxkBBZo+qXE3BzTLbwhRFrUMNdhU+bFhN2LAKRO4CKaLtsLDVIDONNVm+H6hUgc 01bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8xs0dLpLOjPpVnPASrxUlEldZYCSMQdMwxiE4uRpAVE=; b=mqImM7fgBRvMBJwZF5zQs6gmr7MXmPBxjfuDz5bmFOFb1NwnISGpZabCnBh1NbFQoA 2z2udPokH7MsEnO/VYPoY87yCh5JK08fE8lsPJsEooT2552fGgNT8HaPZL+qiIiJuXDP eQcjLGZPNJdnDDPUEoMWwg4UIOz1l5sihwPPBQu7LA5NZa+1UhOHI6wXLQOqrMMhGP8J p7tay4O8RF/XlJSMiL86zcBXswG2zika190NXNge8+S9Oh2FLlP5upj4zXBsggnZw/8j X7q9Bgn6sVfwmCdGFyH8wJQcVKS0noBe0TA7KjmmZZFFimufDRdkUxaQB5V6sUGbVKdX Wv6g== X-Gm-Message-State: AOAM530h0Fn0YCyx2QQZvoPFAtUussEWP0q2lk45yw0Nt5kPuwY4Rm04 zoDmccM7C4CaSF3zH8fPnisTFXdfmPm17zhS X-Received: by 2002:a17:906:2287:: with SMTP id p7mr2432792eja.377.1619764025915; Thu, 29 Apr 2021 23:27:05 -0700 (PDT) Received: from hthiery.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id p4sm1340958ejr.81.2021.04.29.23.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 23:27:05 -0700 (PDT) From: Heiko Thiery To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stephen Hemminger , Petr Vorel , Heiko Thiery Subject: [PATCH iproute2-next v2] lib/fs: fix issue when {name,open}_to_handle_at() is not implemented Date: Fri, 30 Apr 2021 08:26:33 +0200 Message-Id: <20210430062632.21304-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With commit d5e6ee0dac64b64e the usage of functions name_to_handle_at() and open_by_handle_at() are introduced. But these function are not available e.g. in uclibc-ng < 1.0.35. To have a backward compatibility check for the availability in the configure script and in case of absence do a direct syscall. Signed-off-by: Heiko Thiery --- v2: - small correction to subject - removed IP_CONFIG_HANDLE_AT:=y option since it is not required - fix indentation in check function - removed empty lines (thanks to Petr Vorel) - add #define _GNU_SOURCE in check (thanks to Petr Vorel) - check only for name_to_handle_at (thanks to Peter Vorel) configure | 28 ++++++++++++++++++++++++++++ lib/fs.c | 21 +++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/configure b/configure index 2c363d3b..179eae08 100755 --- a/configure +++ b/configure @@ -202,6 +202,31 @@ EOF rm -f $TMPDIR/setnstest.c $TMPDIR/setnstest } +check_name_to_handle_at() +{ + cat >$TMPDIR/name_to_handle_at_test.c < +#include +#include +int main(int argc, char **argv) +{ + struct file_handle *fhp; + int mount_id, flags, dirfd; + char *pathname; + name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags); + return 0; +} +EOF + if $CC -I$INCLUDE -o $TMPDIR/name_to_handle_at_test $TMPDIR/name_to_handle_at_test.c >/dev/null 2>&1; then + echo "yes" + echo "CFLAGS += -DHAVE_HANDLE_AT" >>$CONFIG + else + echo "no" + fi + rm -f $TMPDIR/name_to_handle_at_test.c $TMPDIR/name_to_handle_at_test +} + check_ipset() { cat >$TMPDIR/ipsettest.c <