Comment 4 for bug 1469143

Revision history for this message
Simo Punnonen (simo-punnonen) wrote :

is the lo_name which gets stored in the loop_info structure actually required to be an actual file path or is it enough to be an arbitrary string identifier?

If it doesn't have to be a file path, could it be for instance a sha1 hash of the provided path? That fits into 40 chars and is relatively fast to calculate. A sha1 identifier would make it really hard to collide with other loop device identifiers _unless_ you pass and use the same relative image path in two separate instances (which is also an existing problem).

Alternatively it would be nice if the lo_name identifier wasn't actually based on path but some unique property of the mounted file, that way you would only need to point to an image, regardless of the path and kpartx could find if that specific image is mounted or not.