From patchwork Wed Feb 13 11:20:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Jansen X-Patchwork-Id: 2135341 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 6F91ADFE75 for ; Wed, 13 Feb 2013 11:20:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933764Ab3BMLUG (ORCPT ); Wed, 13 Feb 2013 06:20:06 -0500 Received: from xp-ob.rzone.de ([81.169.146.141]:11632 "EHLO xp-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932536Ab3BMLUF (ORCPT ); Wed, 13 Feb 2013 06:20:05 -0500 X-RZG-CLASS-ID: xp Received: from pizpot.store ([192.168.43.236]) by josoe.store (josoe xp3) (RZmta 31.14 OK) with ESMTP id p02a77p1CKSP4D ; Wed, 13 Feb 2013 12:20:01 +0100 (CET) From: Arne Jansen To: shyam.btrfs@gmail.com Cc: linux-btrfs@vger.kernel.org, list.btrfs@jan-o-sch.net Subject: [PATCH] Btrfs: fix crash in log replay with qgroups enabled Date: Wed, 13 Feb 2013 12:20:01 +0100 Message-Id: <1360754401-24807-1-git-send-email-sensille@gmx.net> X-Mailer: git-send-email 1.8.1.3 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org When replaying a log tree with qgroups enabled, tree_mod_log_rewind does a sanity-check of the number of items against the maximum possible number. It calculates that number with the nodesize of fs_root. Unfortunately fs_root is not yet set at this stage. So instead use the nodesize from tree_root, which is already initialized. Signed-off-by: Arne Jansen --- fs/btrfs/ctree.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index eea5da7..6eff0fa 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1222,7 +1222,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, __tree_mod_log_rewind(eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) > - BTRFS_NODEPTRS_PER_BLOCK(fs_info->fs_root)); + BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root)); return eb_rewin; }