From patchwork Thu Dec 20 12:52:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10738839 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 1CBC4746 for ; Thu, 20 Dec 2018 12:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 090EA2881A for ; Thu, 20 Dec 2018 12:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDCEE28790; Thu, 20 Dec 2018 12:52:27 +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,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 9A38E28790 for ; Thu, 20 Dec 2018 12:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731411AbeLTMw1 (ORCPT ); Thu, 20 Dec 2018 07:52:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:60586 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728966AbeLTMw1 (ORCPT ); Thu, 20 Dec 2018 07:52:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9C8C0AE41; Thu, 20 Dec 2018 12:52:25 +0000 (UTC) From: Johannes Thumshirn To: Eryu Guan Cc: fstests@vger.kernel.org, Johannes Thumshirn Subject: [PATCH] common/rc: create $RESULT_BASE before dumping kmemleak leaks Date: Thu, 20 Dec 2018 13:52:22 +0100 Message-Id: <20181220125222.12041-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In _init_kmemleak() we're touching a check_kmemleak file in ${RESULT_BASE} if ${DEBUGFS_MNT/kmemleak} exists as a marker that we have to check for kmemleak output after running a test. In 'check' we're calling _init_kmemleak() at around 60% of the file, but ${RESULT_BASE} is created later at around 62% of the file, causing the 'touch' in _init_kmemleak() to fail. The workaround to this is creating ${RESULT_BASE} before touching ${RESULT_BASE}/check_kmemleak to always have the marker. Signed-off-by: Johannes Thumshirn Reviewed-by: Darrick J. Wong --- common/rc | 1 + 1 file changed, 1 insertion(+) diff --git a/common/rc b/common/rc index e5da648466eb..5565b63e07ed 100644 --- a/common/rc +++ b/common/rc @@ -3528,6 +3528,7 @@ _init_kmemleak() # then dump all the leaks recorded so far. if echo "scan=off" > "$kern_knob" 2>/dev/null; then _capture_kmemleak /dev/null + mkdir -p ${RESULT_BASE} touch ${RESULT_BASE}/check_kmemleak fi }