Re: eject /dev/cdrom --> oops. (a better patch)

Bill Hawes (whawes@star.net)
Wed, 29 Oct 1997 20:55:19 -0500


David Woodhouse wrote:
> This, one the other hand, is, although I'm not sure it's the _right_ fix.
> This patch still puts the check into get_filesystem_info, but it also makes
> sure that do_mount will remove a vfsmnt entry after failing to complete the
> mount, rather than leaving a half-initialised entry.
>
> This has the side-effect that it will remove any existing vfsmnt entry for the
> device in question if a mount fails. As I understand it, there shouldn't be
> one anyway, but it's a case that the existing code checked for.
>
> Would someone who knows what they're talking about care to pass judgement?

Perhaps I've missed something, but in looking at the 2.1.60 do_mount
source I don't see any cases where you get a partial vfsmount
structure. If add_vfsmnt returns a structure, it should be OK; if it
returns NULL, there's nothing to clean up.

OTOH, add_vfsmnt itself could use a little more error-checking.

Regards,
Bill