From patchwork Thu Aug 9 21:40:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10561927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EEEC139A for ; Thu, 9 Aug 2018 21:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C0922B95B for ; Thu, 9 Aug 2018 21:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E8CA2B99C; Thu, 9 Aug 2018 21:40:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A09A2B95B for ; Thu, 9 Aug 2018 21:40:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727271AbeHJAHB (ORCPT ); Thu, 9 Aug 2018 20:07:01 -0400 Received: from mail-pf1-f172.google.com ([209.85.210.172]:45047 "EHLO mail-pf1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbeHJAHB (ORCPT ); Thu, 9 Aug 2018 20:07:01 -0400 Received: by mail-pf1-f172.google.com with SMTP id k21-v6so3446115pff.11 for ; Thu, 09 Aug 2018 14:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=7tZ7sRrR1bEgyztDSJ1sD+cDZNM8xFAY4kM1MY0C0Rk=; b=xNIA7PZAREFqf8Jc+MNLV06mZmmlGilE08qGomJiXnzadKjXST87sfla7u8eVWal3p 4zXsPvBNxKXwP4PRTpVTJUCkHVRTbq8fFFn1Sc6jAnnU0SRZsguvUIQMnrLaDI3BwEZi ttubmEoLRy/9Keh3lsO2NP3Vcpk+w8FQDEoGd4w4Fr5l0X4RXfn0z4xfkWYQ3dqmH4Ld 3Y34MAa4+nB4XSOOxxhjX5buf4oScEzcwd86xwlrDJ1CQ9zZ8RIqVK6lZM127u64+T5J WM2M7r+w4o/eDWAFKXqnbr/LZUFp6Wbhq2JUWVxxo7g5mmBhYs1XP49AoStGokRIAwxi yWPg== 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; bh=7tZ7sRrR1bEgyztDSJ1sD+cDZNM8xFAY4kM1MY0C0Rk=; b=ICzJM5Y7ggVlAbqBV+dTlJokKh1nJHofRF/sXqKI4wLll3hYSGDRPCkBtzYJog4phK 5Imb59auLydAevdRlYogrrPLuNRhNScgOci59+c2QlrsCEchJ/LDjs+8ovhQdBGRxRtA se0gJmNzObnS+PGL0buZiXtKbPD1zr0yolHkTLsIG0sMghcu2lC4IMWLlp7l1TfgCKCq 5jNM7eBw8Nmr8afIFeT5oK15hMtDs502Hwg1Wd1I79x+CrESgLEk4zUNncCWFF+wpZ5K U3rOvhjJCp9rDFMYs0VsjQ1CbVsp8iZJSwT+DHvUfLU9cT2nRON04LzavlXjT8iBNh53 9oWQ== X-Gm-Message-State: AOUpUlH6MFTIymLSD7VaU0zltO+ZFlUFbKeFjne/KAmIQO8z1TSLvdY6 pTHKYepvx8Jr6g+BkaiZOXxtSQYAvR8= X-Google-Smtp-Source: AA+uWPwKrXAb5KzNvAt1kWPF8hqLCl7p5hRCtJiF8Jfav70bG7ljJPgl85+757k2VrZYEVUEBkNpog== X-Received: by 2002:a63:144b:: with SMTP id 11-v6mr3781581pgu.219.1533850816918; Thu, 09 Aug 2018 14:40:16 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::4:dd24]) by smtp.gmail.com with ESMTPSA id v23-v6sm9390106pfm.80.2018.08.09.14.40.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 14:40:16 -0700 (PDT) From: Omar Sandoval To: fstests@vger.kernel.org Cc: kernel-team@fb.com, Eric Sandeen Subject: [PATCH] generic/228: fix restoration of kernel.core_pattern sysctl Date: Thu, 9 Aug 2018 14:40:12 -0700 Message-Id: <83cc171697f79477991c501939dcda146aa7ba3b.1533850682.git.osandov@fb.com> X-Mailer: git-send-email 2.18.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval generic/228 changes kernel.core_pattern, so it saves it beforehand in order to restore it. However, it adds an extra space in the process: $ echo \"$(sysctl kernel.core_pattern | awk -F = '{print $NF}')\" " |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" Instead of using awk, just use sysctl -n to only print the value. Signed-off-by: Omar Sandoval Reviewed-by: Eric Sandeen --- tests/generic/228 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/228 b/tests/generic/228 index fd022313..16178c33 100755 --- a/tests/generic/228 +++ b/tests/generic/228 @@ -45,7 +45,7 @@ avail=`df -P $TEST_DIR | awk 'END {print $4}'` [ "$avail" -ge 104000 ] || _notrun "Test device is too small ($avail KiB)" # Suppress core dumped messages -core_pattern=`sysctl kernel.core_pattern | awk -F = '{print $NF}'` +core_pattern=`sysctl -n kernel.core_pattern` ulimit_c=`ulimit -c` sysctl -w kernel.core_pattern=core &>/dev/null ulimit -c 0