From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Fri, 21 Nov 2008 09:55:56 +0000 Subject: Re: LifeDrive filsystem probe fails [mjg59@srcf.ucam.org: Re: LifeDrive and T|X not seen by hal] Message-Id: List-Id: References: <20081111142943.GB18544@zigg.com> In-Reply-To: <20081111142943.GB18544@zigg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, Nov 20, 2008 at 15:50, Kay Sievers wrote: > On Thu, Nov 20, 2008 at 14:17, Karel Zak wrote: >> On Thu, Nov 13, 2008 at 08:01:34PM +0100, Kay Sievers wrote: >>> We always probe for all filesystem types on volumes larger than a >>> floppy disk. If we find multiple signatures and one of the detected >>> filesystem types specifies that it can no co-exist with another known >>> filesystem, like swap and FAT, we do not return a probing result. >> >> I see the patch (volume_id_probe_filesystem()) and a few things come >> to mind: >> >> - shouldn't be the relevant parts (label, uuid, version, ...) of >> the "struct volume_id" zeroized when you found a signature and >> before you call the next probing function? > > Sounds good, yes. > >> - it seems as overkill to use two for()s and probe two times for all >> filesystems. What about to store the first result and re-use it? > > We can do that, sure. > > One thing to keep in mind for your new lib is to allocate all the > results individually and return them all to the caller, I guess. So > cleaning or copying results like here would not be needed, and the > caller can decide what to do with conflicting results. > >> - .. or at least never use the second for() when the fist for() found >> nothing ;-) > > Good point. :) I changed it. In case of multiple matches, it re-probes only the first match again, all other cases are not probed twice. I hope we can switch over to your new lib soon, so we don't do the same stuff twice all the time. :) Thanks, Kay