From patchwork Wed Nov 27 05:33:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 3246471 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 06ED49F3B8 for ; Wed, 27 Nov 2013 05:32:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F3B12049C for ; Wed, 27 Nov 2013 05:32:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8267A20445 for ; Wed, 27 Nov 2013 05:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752776Ab3K0Fcj (ORCPT ); Wed, 27 Nov 2013 00:32:39 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:3317 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750953Ab3K0Fci (ORCPT ); Wed, 27 Nov 2013 00:32:38 -0500 X-IronPort-AV: E=Sophos;i="4.93,779,1378828800"; d="scan'208";a="9135210" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 27 Nov 2013 13:29:10 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id rAR5WXtT019628 for ; Wed, 27 Nov 2013 13:32:36 +0800 Received: from adam-work.lan ([10.167.226.24]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013112713302605-451728 ; Wed, 27 Nov 2013 13:30:26 +0800 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: quwenruo@cn.fujitsu.com Subject: [PATCH v4] btrfs-progs: Fix a segfault when using btrfs-corrupt-block with "-U" Date: Wed, 27 Nov 2013 13:33:28 +0800 Message-Id: <1385530408-28858-1-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 1.8.4.2 X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/11/27 13:30:26, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/11/27 13:30:29, Serialize complete at 2013/11/27 13:30:29 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.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 When using "-U" option with btrfs-corrupt-block, it will cause a segfault due to a missing break in getopt switch. Reported-by: Wang Shilong Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c index f0c14a9..a2828d4 100644 --- a/btrfs-corrupt-block.c +++ b/btrfs-corrupt-block.c @@ -758,6 +758,7 @@ int main(int ac, char **av) break; case 'U': chunk_tree = 1; + break; case 'i': inode = atoll(optarg); if (inode == 0) {