From patchwork Mon Nov 23 12:56:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 7680951 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D9FF9F6E4 for ; Mon, 23 Nov 2015 12:56:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA5DF206F9 for ; Mon, 23 Nov 2015 12:56:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B990520704 for ; Mon, 23 Nov 2015 12:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753555AbbKWM43 (ORCPT ); Mon, 23 Nov 2015 07:56:29 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:22817 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbbKWM42 (ORCPT ); Mon, 23 Nov 2015 07:56:28 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tANCuQU0028825 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Nov 2015 12:56:26 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tANCuQuC008557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 23 Nov 2015 12:56:26 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tANCuPx0005264; Mon, 23 Nov 2015 12:56:25 GMT Received: from arch2.sg.oracle.com (/10.186.101.159) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Nov 2015 04:56:25 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 5/5] btrfs-progs: add warning when we fail to read sysfs or version Date: Mon, 23 Nov 2015 20:56:18 +0800 Message-Id: <1448283378-10579-6-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448283378-10579-1-git-send-email-anand.jain@oracle.com> References: <1448283378-10579-1-git-send-email-anand.jain@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] 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 Signed-off-by: Anand Jain --- btrfs-convert.c | 10 +++++++++- mkfs.c | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index 52ea12a..b0a998b 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2898,14 +2898,22 @@ int main(int argc, char *argv[]) char fslabel[BTRFS_LABEL_SIZE]; u64 features; - if (btrfs_features_allowed_by_sysfs(&features)) + if (btrfs_features_allowed_by_sysfs(&features)) { + fprintf(stderr, + "Warning: Failed/Unsupported to obtain feature list from sysfs\n"); + features = btrfs_features_allowed_by_kernel(); + if (!features) + fprintf(stderr, + "Warning: Failed/Unsupported to get running kernel version\n"); + } if (features) features &= BTRFS_MKFS_DEFAULT_FEATURES; else features = BTRFS_MKFS_DEFAULT_FEATURES; + while(1) { enum { GETOPT_VAL_NO_PROGRESS = 256 }; static const struct option long_options[] = { diff --git a/mkfs.c b/mkfs.c index 4f46ad9..6cb998b 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1367,8 +1367,14 @@ int main(int ac, char **av) * fails then default to the progs default, which is set as per * BTRFS_MKFS_DEFAULT_FEATURES */ - if (btrfs_features_allowed_by_sysfs(&features)) + if (btrfs_features_allowed_by_sysfs(&features)) { + fprintf(stderr, + "Warning: Failed/Unsupported to obtain feature list from sysfs\n"); features = btrfs_features_allowed_by_kernel(); + if (!features) + fprintf(stderr, + "Warning: Failed/Unsupported to get running kernel version\n"); + } if (features) features &= BTRFS_MKFS_DEFAULT_FEATURES;