On Thu, Nov 20, 2008 at 15:50, Kay Sievers <kay.sievers@xxxxxxxx> wrote: > On Thu, Nov 20, 2008 at 14:17, Karel Zak <kzak@xxxxxxxxxx> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html