From patchwork Thu Aug 16 03:17:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 177890 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D97AD2C008A for ; Thu, 16 Aug 2012 13:18:11 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753853Ab2HPDR4 (ORCPT ); Wed, 15 Aug 2012 23:17:56 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:54823 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855Ab2HPDRl convert rfc822-to-8bit (ORCPT ); Wed, 15 Aug 2012 23:17:41 -0400 Received: from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net [74.93.104.98]) by shards.monkeyblade.net (Postfix) with ESMTPSA id 072D6585395; Wed, 15 Aug 2012 20:17:42 -0700 (PDT) Date: Wed, 15 Aug 2012 20:17:38 -0700 (PDT) Message-Id: <20120815.201738.1239404312150755618.davem@davemloft.net> To: armin76@gentoo.org Cc: sparclinux@vger.kernel.org Subject: Re: SILO fails to read silo.conf from EXT4 FS From: David Miller In-Reply-To: <5015201A.8060309@gentoo.org> References: <5015201A.8060309@gentoo.org> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Raúl Porcel Date: Sun, 29 Jul 2012 13:35:54 +0200 > With the rewrite of the e2fs part of SILO, its unable to read > /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, > though. There are some minor errors in the extent leaf traversal, can you try this patch below? If this fails I'll give you a patch which adds some tracing so we can diagnose this further. Thanks! --- To unsubscribe from this list: send the line "unsubscribe sparclinux" 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/second/fs/ext2.c b/second/fs/ext2.c index 7eb665f..018aced 100644 --- a/second/fs/ext2.c +++ b/second/fs/ext2.c @@ -147,7 +147,7 @@ static struct ext4_extent_header *search_leaf(struct silo_ext2_state *s, return ehp; for (i = 0; i < ext2_to_cpu_16(ehp->eh_entries); i++, idxp++) - if (ext2_to_cpu_32(idxp->ei_block) > file_block) + if (file_block < ext2_to_cpu_32(idxp->ei_block)) break; if (i == 0) @@ -226,14 +226,15 @@ static unsigned long long resolve_extent(struct silo_ext2_state *s, ep = (struct ext4_extent *) (ehp + 1); for (i = 0; i < ext2_to_cpu_16(ehp->eh_entries); i++, ep++) - if (ext2_to_cpu_32(ep->ee_block) > file_block) + if (file_block < ext2_to_cpu_32(ep->ee_block)) break; if (i == 0) return BLOCK_MAP_ERROR; + ep -= 1; file_block -= ext2_to_cpu_32(ep->ee_block); - if (ext2_to_cpu_16(ep->ee_len) < file_block) + if (file_block >= ext2_to_cpu_16(ep->ee_len)) return BLOCK_MAP_ERROR; hi = ((unsigned long long)ext2_to_cpu_16(ep->ee_start_hi)) << 32;