From patchwork Thu Jun 5 02:02:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 4300711 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 463AF9F358 for ; Thu, 5 Jun 2014 02:08:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8906D202E5 for ; Thu, 5 Jun 2014 02:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3BC7202EC for ; Thu, 5 Jun 2014 02:08:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbaFECH7 (ORCPT ); Wed, 4 Jun 2014 22:07:59 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:11405 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751591AbaFECH5 (ORCPT ); Wed, 4 Jun 2014 22:07:57 -0400 X-IronPort-AV: E=Sophos;i="4.98,977,1392134400"; d="scan'208";a="31476929" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 05 Jun 2014 10:05:19 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s5527tsP016994 for ; Thu, 5 Jun 2014 10:07:55 +0800 Received: from localhost.localdomain (10.167.226.111) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 5 Jun 2014 10:08:06 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH] btrfs-progs: show meaningful msgs for replace cmd upon raid56 Date: Thu, 5 Jun 2014 10:02:52 +0800 Message-ID: <1401933772-23447-2-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1401933772-23447-1-git-send-email-guihc.fnst@cn.fujitsu.com> References: <1401933772-23447-1-git-send-email-guihc.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.111] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This depends on the kernel patch: [PATCH] btrfs:replace EINVAL with EOPNOTSUPP for dev_replace This catches the EOPNOTSUPP and output msg that says dev_replace raid56 is not currently supported. Note that the msg will only be shown when run dev_replace not in background. Signed-off-by: Gui Hecheng --- cmds-replace.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmds-replace.c b/cmds-replace.c index 9eb981b..8b18110 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -301,6 +301,10 @@ static int cmd_start_replace(int argc, char **argv) "ERROR: ioctl(DEV_REPLACE_START) failed on \"%s\": %s, %s\n", path, strerror(errno), replace_dev_result2string(start_args.result)); + + if (errno == EOPNOTSUPP) + fprintf(stderr, "WARNING: dev_replace cannot yet handle RAID5/RAID6\n"); + goto leave_with_error; }