From patchwork Mon May 2 18:13:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 8994191 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 5672F9F1C1 for ; Mon, 2 May 2016 18:13:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C5522024F for ; Mon, 2 May 2016 18:13:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0D2020225 for ; Mon, 2 May 2016 18:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889AbcEBSNB (ORCPT ); Mon, 2 May 2016 14:13:01 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32477 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754672AbcEBSM7 (ORCPT ); Mon, 2 May 2016 14:12:59 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u42ICqHn016672 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 May 2016 18:12:52 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u42ICqRr011788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 May 2016 18:12:52 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u42ICntf020094; Mon, 2 May 2016 18:12:50 GMT Received: from localhost.us.oracle.com (/10.211.47.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 02 May 2016 11:12:49 -0700 From: Liu Bo To: linux-btrfs@vger.kernel.org Cc: quwenruo@cn.fujitsu.com Subject: [PATCH] Btrfs-progs: fix incorrect flag check Date: Mon, 2 May 2016 11:13:20 -0700 Message-Id: <1462212800-26837-1-git-send-email-bo.li.liu@oracle.com> X-Mailer: git-send-email 2.5.5 X-Source-IP: aserv0022.oracle.com [141.146.126.234] 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.9 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 The flag OPEN_CTREE_RECOVER_SUPER is set when it's going to recover any bad superblock copy, the current code doesn't match that. Signed-off-by: Liu Bo --- disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disk-io.c b/disk-io.c index 6fcca42..2c22156 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1264,7 +1264,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path, goto out; disk_super = fs_info->super_copy; - if (!(flags & OPEN_CTREE_RECOVER_SUPER)) + if (flags & OPEN_CTREE_RECOVER_SUPER) ret = btrfs_read_dev_super(fs_devices->latest_bdev, disk_super, sb_bytenr, 1); else