From patchwork Sun Jan 12 13:38:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3472231 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 1DDA89F2E9 for ; Sun, 12 Jan 2014 13:39:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C0BD20123 for ; Sun, 12 Jan 2014 13:39:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A005720103 for ; Sun, 12 Jan 2014 13:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054AbaALNjH (ORCPT ); Sun, 12 Jan 2014 08:39:07 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:52644 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbaALNim (ORCPT ); Sun, 12 Jan 2014 08:38:42 -0500 Received: by mail-pb0-f48.google.com with SMTP id md12so2135pbc.35 for ; Sun, 12 Jan 2014 05:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=RLidZ5PhTyw6QqP8zutPC1qI/02RnW6WctNH8/SRkUM=; b=oF9bGXWLHOGxAjqMJaDwk8qa8ZmwxJEWasrT0fEXX7+ibMEzx4kl+hjCu6ELfwKu4X cHe4xq6GdKGpEfWQJ/brdOLwp30bLmrVEWz7nV6VeZAEMWvGtG2KV515YpTjCEjbE7NW 1GSu9j2tKjxmVRPP1KBa7N9fEjwY8Byd2vNINmjpZnM1SkpXE/J0TnYPXfhVumEpcuu+ 1BnFxTFsk5CZ/AbzqCSF3q70MztMXNnoQ4JhAjvyx1X6IX5KnqZ7hGvBrTiV/DTPBfyQ gMaPdaSxl8XQgWST0wLDoLTjYtzrnjZ2T2KN1gwD9Zd4ImSkHsNGUuw90QlWL/b/z5rp UJ9Q== X-Received: by 10.68.252.5 with SMTP id zo5mr24073012pbc.10.1389533921967; Sun, 12 Jan 2014 05:38:41 -0800 (PST) Received: from linux-b0ol.localdomain ([223.65.51.231]) by mx.google.com with ESMTPSA id jn12sm30944540pbd.37.2014.01.12.05.38.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jan 2014 05:38:41 -0800 (PST) From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/3] Btrfs: fix missing skinny metadata check in scrub_stripe() Date: Sun, 12 Jan 2014 21:38:32 +0800 Message-Id: <1389533914-2272-2-git-send-email-wangshilong1991@gmail.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1389533914-2272-1-git-send-email-wangshilong1991@gmail.com> References: <1389533914-2272-1-git-send-email-wangshilong1991@gmail.com> 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, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Wang Shilong Check if we support skinny metadata firstly and fix to use right type to search. Signed-off-by: Wang Shilong --- fs/btrfs/scrub.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 7806e2c..e0677e4 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2373,8 +2373,11 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, scrub_blocked_if_needed(fs_info); } + if (btrfs_fs_incompat(fs_info, SKINNY_METADATA)) + key.type = BTRFS_METADATA_ITEM_KEY; + else + key.type = BTRFS_EXTENT_ITEM_KEY; key.objectid = logical; - key.type = BTRFS_EXTENT_ITEM_KEY; key.offset = (u64)-1; ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);