From patchwork Wed Feb 27 02:31:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 2191881 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CF78EDF215 for ; Wed, 27 Feb 2013 02:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758129Ab3B0CcP (ORCPT ); Tue, 26 Feb 2013 21:32:15 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:37909 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755377Ab3B0CcO (ORCPT ); Tue, 26 Feb 2013 21:32:14 -0500 Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 2FA1B3EE0BB for ; Wed, 27 Feb 2013 11:32:13 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 18AAF45DE55 for ; Wed, 27 Feb 2013 11:32:13 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 0188E45DE58 for ; Wed, 27 Feb 2013 11:32:13 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id E5261E0800E for ; Wed, 27 Feb 2013 11:32:12 +0900 (JST) Received: from m1000.s.css.fujitsu.com (m1000.s.css.fujitsu.com [10.240.81.136]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 9F4DAE08004 for ; Wed, 27 Feb 2013 11:32:12 +0900 (JST) Received: from m1000.css.fujitsu.com (m1000 [127.0.0.1]) by m1000.s.css.fujitsu.com (Postfix) with ESMTP id 7DBF4614D6; Wed, 27 Feb 2013 11:32:12 +0900 (JST) Received: from FM-323941448.jp.fujitsu.com (unknown [10.124.101.82]) by m1000.s.css.fujitsu.com (Postfix) with SMTP id 41FCE61473; Wed, 27 Feb 2013 11:32:12 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-Id: <201302270231.AA00022@FM-323941448.jp.fujitsu.com> From: Tsutomu Itoh Date: Wed, 27 Feb 2013 11:31:54 +0900 To: chris.mason@fusionio.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs-progs: fix segmentation fault of "btrfs check" MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Segmentation fault occurred in the following command. # btrfs check /dev/sdc7 No valid Btrfs found on /dev/sdc7 Segmentation fault (core dumped) Fix it. Signed-off-by: Tsutomu Itoh --- cmds-check.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/cmds-check.c b/cmds-check.c index d63e945..5d2e9ed 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3610,12 +3610,12 @@ int cmd_check(int argc, char **argv) } info = open_ctree_fs_info(argv[optind], bytenr, rw, 1); - uuid_unparse(info->super_copy.fsid, uuidbuf); - printf("Checking filesystem on %s\nUUID: %s\n", argv[optind], uuidbuf); - if (info == NULL) return 1; + uuid_unparse(info->super_copy.fsid, uuidbuf); + printf("Checking filesystem on %s\nUUID: %s\n", argv[optind], uuidbuf); + if (!extent_buffer_uptodate(info->tree_root->node) || !extent_buffer_uptodate(info->dev_root->node) || !extent_buffer_uptodate(info->extent_root->node) ||