Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LiXxf-0002rR-BB for mharc-grub-devel@gnu.org; Sat, 14 Mar 2009 13:47:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LiXxd-0002qq-Cy for grub-devel@gnu.org; Sat, 14 Mar 2009 13:47:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LiXxY-0002oW-HR for grub-devel@gnu.org; Sat, 14 Mar 2009 13:47:48 -0400 Received: from [199.232.76.173] (port=53718 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiXxY-0002oJ-20 for grub-devel@gnu.org; Sat, 14 Mar 2009 13:47:44 -0400 Received: from ti-out-0910.google.com ([209.85.142.189]:13329) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LiXxX-0006VU-Cz for grub-devel@gnu.org; Sat, 14 Mar 2009 13:47:43 -0400 Received: by ti-out-0910.google.com with SMTP id j3so532417tid.10 for ; Sat, 14 Mar 2009 10:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=YImLQOelyXfAjt/IG0UDe24R6mQZbG9umjczTVdI7v8=; b=Xpzw5ZEn2/dnObUYODGruTXgO/h58u5MTO9KesqVJV10e7BxXQJuHJZg7xIEgcDfax IqOrS3sIGQunACnB331oaZH4mOwmjvuy7CyDfDH6gJoUFtzRE3DZKAUqdnxp/r3IXyDs tubhpF/mnfI4XjAR4iaAwpCAty/RsMaQxeknA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fqiQ4q2fjlKB+FDXiAR7z+ayU61At2eioKYdZbvek2IgO9UBs78yVPgjVDUW/VxYbI Xs1krJynAl1OrwyBFOzmsYOYkMN/omXXjy21D+M6sV4MvkaxH84985wmtBjIMGJy0K8o VJWgSnfhcMNcwSJjtWWaCHpfHJiZ+7b7m5RAY= MIME-Version: 1.0 Received: by 10.110.86.3 with SMTP id j3mr145705tib.57.1237052861220; Sat, 14 Mar 2009 10:47:41 -0700 (PDT) In-Reply-To: <20090314173523.GA14401@thorin> References: <20090314163757.GA13991@thorin> <20090314173523.GA14401@thorin> Date: Sun, 15 Mar 2009 01:47:41 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Bug fix for ext2.c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2009 17:47:49 -0000 On Sun, Mar 15, 2009 at 1:35 AM, Robert Millan wrote: > On Sun, Mar 15, 2009 at 12:56:26AM +0800, Bean wrote: >> On Sun, Mar 15, 2009 at 12:37 AM, Robert Millan wrote: >> > On Sun, Mar 15, 2009 at 12:16:23AM +0800, Bean wrote: >> >> Hi, >> >> >> >> I've discovered a bug in ext2.c, inside grub_ext2_mount. The mount >> >> function must return GRUB_ERR_BAD_FS if something goes wrong, because >> >> grub_fs_probe would stop as soon as it sees a non-GRUB_ERR_BAD_FS >> >> error, thus preventing other fs driver from detecting the correct fs >> >> type. This patch fixes the problem. >> > >> > I think current behaviour is correct. =A0If a failure is triggered by >> > grub_disk_read(), from grub_fs_probe perspective it means something is >> > fucked up other than just "this is not the FS we're looking for", so i= t >> > should be aware of the difference. >> > >> > Or is grub_ext2_read_inode() failure the one that's causing trouble fo= r >> > you? >> >> Hi, >> >> ext2 only reads the first two sectors in mount, which is normally ok , >> but there are exceptions. For example, cpio filesystem could be less >> one sector. > > I don't understand what you mean here. =A0If grub_disk_read failed, this > indicates something's broken down in the disk layer doesn't it? =A0How is > the number of sectors related to this? > Hi, grub_disk_read checks for disk limit. For example, cpio file system can be one sector long, trying to read two sectors would cause a out of range error. >> Also, hostfs always return error in its read function, >> which would cause ext2 to fail. The effect can be seen in grub-fstest. >> hostfs is the first fs driver to register, and the last to query. When >> accessing the (host) device, ext2 cause it to fail before hostfs has a >> chance to see it. > > Why does hostfs fail? =A0Is this intentional? Yes, it's intentional. Reading raw sectors from (host) doesn't make much sense. The (host) device is a place holder for hostfs filesystem. --=20 Bean