From patchwork Thu Oct 30 04:43:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 5193351 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A1216C11AC for ; Thu, 30 Oct 2014 04:01:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1863201FE for ; Thu, 30 Oct 2014 04:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 440F0201C7 for ; Thu, 30 Oct 2014 04:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948AbaJ3EA4 (ORCPT ); Thu, 30 Oct 2014 00:00:56 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48989 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbaJ3EA4 (ORCPT ); Thu, 30 Oct 2014 00:00:56 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s9U40tYq016054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 Oct 2014 04:00:55 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9U40sbC028922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 30 Oct 2014 04:00:55 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9U40sPp028916 for ; Thu, 30 Oct 2014 04:00:54 GMT Received: from OL.sg.oracle.com (/10.186.101.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Oct 2014 21:00:54 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH v2] revert btrfs-progs: do a separate probe for _transient_ replacing device Date: Thu, 30 Oct 2014 12:43:03 +0800 Message-Id: <1414644183-19189-1-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.0.0.153.g79dcccc In-Reply-To: <1414579862-18951-1-git-send-email-anand.jain@oracle.com> References: <1414579862-18951-1-git-send-email-anand.jain@oracle.com> X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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=unavailable 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 There is a compatibility issue with older kernel with the progs commit id as below. d0588bfa479409b2a0f6243f894338a01a56221a btrfs-progs: do a separate probe for _transient_ replacing device So as of now writing to revert the above commit id. The brewing sysfs interface would help to fix the impending issue, which is seed device would fail show in 'btrfs fi show' output of a sprout device. Signed-off-by: Anand Jain --- v2: update commit with correct commit which this patch will revert utils.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/utils.c b/utils.c index a8691fe..1d1cc77 100644 --- a/utils.c +++ b/utils.c @@ -1869,29 +1869,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args, if (!fi_args->num_devices) goto out; - /* - * with kernel patch - * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots - * the kernel now returns total_devices which does not include - * replacing device if running. - * As we need to get dev info of the replace device if it is running, - * so just add one to fi_args->num_devices. - */ - - di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args)); + di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args)); if (!di_args) { ret = -errno; goto out; } - /* get the replace target device if it is there */ - ret = get_device_info(fd, i, &di_args[ndevs]); - if (!ret) { - ndevs++; - fi_args->num_devices++; - } - i++; - for (; i <= fi_args->max_id; ++i) { BUG_ON(ndevs >= fi_args->num_devices); ret = get_device_info(fd, i, &di_args[ndevs]);