Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932587AbWB1VIY (ORCPT ); Tue, 28 Feb 2006 16:08:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932592AbWB1VIY (ORCPT ); Tue, 28 Feb 2006 16:08:24 -0500 Received: from newmail.sw.starentnetworks.com ([12.33.234.78]:50183 "EHLO mail.sw.starentnetworks.com") by vger.kernel.org with ESMTP id S932587AbWB1VIX (ORCPT ); Tue, 28 Feb 2006 16:08:23 -0500 From: Dave Johnson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17412.48069.779583.804584@zeus.sw.starentnetworks.com> Date: Tue, 28 Feb 2006 16:08:21 -0500 To: Chris Mason Cc: agruen@suse.de, Olaf Hering , linux-kernel@vger.kernel.org Subject: Re: cramfs mounts provide corrupted content since 2.6.15 In-Reply-To: <200602281553.01094.mason@suse.com> References: <20060225110844.GA18221@suse.de> <200602281414.57084.mason@suse.com> <17412.46396.581647.436622@zeus.sw.starentnetworks.com> <200602281553.01094.mason@suse.com> X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2127 Lines: 63 Chris Mason writes: > On Tuesday 28 February 2006 15:40, Dave Johnson wrote: > > > What version of mkcramfs are you using? Empty regular files should > > have offset set to 0 already. > > The image is being generated by util-linux 2.12r (this is the root disk for > the SUSE 10.1 install). > > I checked via hexdump, the offset for mtab is definitely not zero. > > -chris > Ah, that makes sense now. parse_directory() is different between util-linux 2.12r and cramfstools 1.1: util-linux 2.12r: } else if (S_ISREG(st.st_mode)) { entry->path = strdup(path); if (entry->size) { if (entry->size >= (1 << CRAMFS_SIZE_WIDTH)) { warn_size = 1; entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1; } } cramfstools 1.1: } else if (S_ISREG(st.st_mode)) { if (entry->size) { if (access(path, R_OK) < 0) { warn_skip = 1; continue; } entry->path = strdup(path); if (!entry->path) { die(MKFS_ERROR, 1, "strdup failed"); } if ((entry->size >= 1 << CRAMFS_SIZE_WIDTH)) { warn_size = 1; entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1; } } in cramfstools entry->path is not set for empty files causing write_data() to keep offset set to 0. -- Dave Johnson Starent Networks - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/