Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp778840img; Wed, 20 Mar 2019 10:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDG7XqkGfDBptnAnTkVUkIXCtBwCEKmqGH/y9oFN2FTHjKbLWTw+tVGgYKQ84osvdooQQI X-Received: by 2002:a63:6a08:: with SMTP id f8mr8585657pgc.165.1553103535320; Wed, 20 Mar 2019 10:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553103535; cv=none; d=google.com; s=arc-20160816; b=ESy4Oga5EFwumSfEY7Kx4lYHjC7ovnfYk0bxo0THEYlmnAWQyZE3rJ6ifIN9Nn4j3x QWCMmSypg2T/spA/nVwrX9jiAGykCjfnsRxLVfcNjYyL7JAq9nCPiiA/rK48S+06HYgS L59UUxzF1Z0P/FGkuqMgRnYSBcH0ejwVdBPuYXykLbjOd2n7IuACFqRpjGWYTqXfLcZ+ ZgtvGl/t2CFCUaGW9cU92yM0CsMDD5YW+EM51gw9krtUs5eUuj8fKL3CcUu9Z/ne5bKT 5z7NNvbtMzgWYP/3I7UJkwWi4ClhTseOu8LtQxqUTpa+QEiz2JCx2Q6GHnchgJwNn/92 zJZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yxkFxOstgye8P+oM5yJDIcooGGf5Gy5OyQ9cdtrDtq4=; b=NaMZD4TSgo+sRgIHlOjtvhw/QLdLM+ZMmHGqcvRE/fFA448pA2EWk1sth1gmuzTCbS +605rcrJ/EdF+uzNCoHYRcXbACHui9iThwtk/Rg1QUkj4Z5ht85yI7sqWB7dOGfUIki1 vVW1FViFehWYd80rOkN2DrWEAguUNZ1cgIRVwe79gbfZL5qhDMQTm6r8TeWUyDZFo1Yg LPVXFkUhQOXL/VVCAtpEJiU6/fY76UE+Km2gALhKF973NDByg8vkBEs9KCHcH/SUG81f 2bh9+SEKg9lCYeJrwJSj9J11PG5USHaVW+5P1zy5w98lku0rB55KdBbhu9MiiY2Rwyaf Z/fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LORM5MVW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si2013225pgq.38.2019.03.20.10.38.40; Wed, 20 Mar 2019 10:38:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LORM5MVW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727462AbfCTRf6 (ORCPT + 99 others); Wed, 20 Mar 2019 13:35:58 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:45267 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbfCTRf5 (ORCPT ); Wed, 20 Mar 2019 13:35:57 -0400 Received: by mail-ed1-f66.google.com with SMTP id m16so2692369edd.12; Wed, 20 Mar 2019 10:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yxkFxOstgye8P+oM5yJDIcooGGf5Gy5OyQ9cdtrDtq4=; b=LORM5MVW4Ay6Ye/3qm3rR2RJ/oaoijM+bjZ1jrK8t6o5euW+5qEvyenxUgZAvXvgpI nvNowIUCkLTdtqepEF+UTlQioY5fnos47wpsrdeQN9bXh+YAxNM5hxtm6H1BCENvO2Ii kET9YS7QBPE/o6HvaQ5+RUvLadAUw9wkDLsRjSCImPHbfaMpcnFHgP70sB80UKpoBK3K 3wg3X6HfvpeQy+obHzRrAGQVSZx6ICkOO+SOqcQ7vwMLd2fDKhaEGgqsWbxXcHhL9hzR Q77q/3umw6HD1Qx8gVOsurBP2B5v3hxVd4qJv2oagknRHj+cAl3VYOu225QxjV0CHU25 fjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yxkFxOstgye8P+oM5yJDIcooGGf5Gy5OyQ9cdtrDtq4=; b=GsIzGL65KGsfgGBnnxJ8m8A51KGngVlJ/F4CfZ+UeaPxMSnSbB21rZfxVMgIsuxIB4 MnOnZWE3fWrS4Ic69fVhES//XC4bCKwiBHite1sRoqOiN60np/HDwTXpTB96G1iD5LBu CcQ4kml3TtgHTi3O+il5gVwQXmCSjQ8iu40WRpPRUsAPOo9cURj2iMZItf0xnQrvFA7C bUCnEwJMnYiA4ErHNDF1yzgLa9RPSJVN8Y6gBofBeWC/O9kZ1GGIetF+Gnra4L8hOMYV +nydbuCrTtuAm18rhrBOSVMh9NLqk26yqqmrZNMt2+GwxJ2txnAFwS0O8Ihrn7RvTWsE MlAQ== X-Gm-Message-State: APjAAAXD03cfD5vXHX7GlVhZXDi4vKqZYsCst1wP3g0TPyPHVLnJ7s5e BTHy0N2S/bZhnoi+ycIQmsM= X-Received: by 2002:a50:be05:: with SMTP id a5mr20795439edi.87.1553103355859; Wed, 20 Mar 2019 10:35:55 -0700 (PDT) Received: from neptune.fritz.box ([178.19.216.175]) by smtp.gmail.com with ESMTPSA id 5sm828606edp.50.2019.03.20.10.35.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 10:35:54 -0700 (PDT) From: Alban Crequy X-Google-Original-From: Alban Crequy To: ast@kernel.org, daniel@iogearbox.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alban@kinvolk.io, iago@kinvolk.io Subject: [PATCH bpf-next v1 7/7] tools: bpftool: add error message on map pinning failure Date: Wed, 20 Mar 2019 18:33:32 +0100 Message-Id: <20190320173332.18105-7-alban@kinvolk.io> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190320173332.18105-1-alban@kinvolk.io> References: <20190320173332.18105-1-alban@kinvolk.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alban Crequy Symptoms, when "dir" does not exist: $ sudo bpftool map create /sys/fs/bpf/dir/fooB type hash key 8 value 8 entries 8 name fooB flags 1 $ echo $? 255 This patch prints an error message when the map pinning fails. Signed-off-by: Alban Crequy --- tools/bpf/bpftool/map.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 9befcabc299d..c825eb1bbf8f 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -1305,8 +1305,10 @@ static int do_create(int argc, char **argv) err = do_pin_fd(fd, pinfile); close(fd); - if (err) + if (err) { + p_err("failed to pin map to %s", pinfile); return err; + } if (json_output) jsonw_null(json_wtr); -- 2.20.1