From patchwork Fri Jan 12 04:16:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Wareing X-Patchwork-Id: 10159599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52AA66029B for ; Fri, 12 Jan 2018 04:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E38C288E8 for ; Fri, 12 Jan 2018 04:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32FBD288EB; Fri, 12 Jan 2018 04:17:00 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A1B9E288EA for ; Fri, 12 Jan 2018 04:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932927AbeALEQ6 (ORCPT ); Thu, 11 Jan 2018 23:16:58 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:46766 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932807AbeALEQ5 (ORCPT ); Thu, 11 Jan 2018 23:16:57 -0500 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0C4FQsb019863 for ; Thu, 11 Jan 2018 20:16:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=ITc4fWafU38vcfoYIKKgJY3hSWtzNQpgpxIzflZgZjU=; b=rhtssF++CzDHCXB98Ao5PPoDowdcJjfUoM4HN9hb4uTn5a6Wmm3cC9LqPhBs1ET9mZQl CD4yXUIY/gNESvtmb0kO5w7vH5xqHMyvyiZps23FcC1OjUCwOJzWzNRYiP2KC7f7w9cV SXuGIMCMkveia9gSceGGa/tTWd5q7xGn/hs= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2fegfa15g6-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 11 Jan 2018 20:16:56 -0800 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB06.TheFacebook.com (192.168.16.16) with Microsoft SMTP Server id 14.3.361.1; Thu, 11 Jan 2018 20:16:55 -0800 Received: from devbig279.prn1.facebook.com (localhost [127.0.0.1]) by devbig279.prn1.facebook.com (Postfix) with ESMTP id 6B4363621A41; Thu, 11 Jan 2018 20:16:20 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Richard Wareing Smtp-Origin-Hostname: devbig279.prn1.facebook.com To: CC: , , Smtp-Origin-Cluster: prn1c29 Subject: [PATCH v4 3/3] xfs/realtime: Fix direct invocations of xfs_repair Date: Thu, 11 Jan 2018 20:16:19 -0800 Message-ID: <20180112041619.540900-4-rwareing@fb.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180112041619.540900-1-rwareing@fb.com> References: <20180112041619.540900-1-rwareing@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-12_02:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes direct invocations of xfs_repair to add in -r option if required. Reviewed-by: Darrick J. Wong Signed-off-by: Richard Wareing --- Changes since v3: * Formatting nits Changes since v2: * Added check for USE_EXTERNAL in tests/xfs/291 & tests/xfs/070 * Call xfs_repair via $XFS_REPAIR_PROG Changes since v1: * Fixed kill -9 in test xfs/070 tests/xfs/070 | 5 ++++- tests/xfs/291 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/xfs/070 b/tests/xfs/070 index 0ae6eff..81111d5 100755 --- a/tests/xfs/070 +++ b/tests/xfs/070 @@ -56,7 +56,10 @@ _cleanup() _xfs_repair_noscan() { # invoke repair directly so we can kill the process if need be - $XFS_REPAIR_PROG $SCRATCH_DEV 2>&1 | tee -a $seqres.full > $tmp.repair & + [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \ + rt_repair_opts="-r $SCRATCH_RTDEV" + $XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 | + tee -a $seqres.full > $tmp.repair & repair_pid=$! # monitor progress for as long as it is running diff --git a/tests/xfs/291 b/tests/xfs/291 index 3f5295c..fd5c1f1 100755 --- a/tests/xfs/291 +++ b/tests/xfs/291 @@ -122,7 +122,10 @@ _xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed" # Can xfs_metadump cope with this monster? _scratch_metadump $tmp.metadump || _fail "xfs_metadump failed" xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed" -xfs_repair -f $tmp.img >> $seqres.full 2>&1 || _fail "xfs_repair of metadump failed" +[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \ + rt_repair_opts="-r $SCRATCH_RTDEV" +$XFS_REPAIR_PROG $rt_repair_opts -f $tmp.img >> $seqres.full 2>&1 || \ + _fail "xfs_repair of metadump failed" # Yes it can; success, all done status=0