Yeah, I think I'll go for the simpler and safer solution.
> Could you describe what are you trying to achieve in the callers of
> check_disc_changed()? I'd been unable to deduce that from code and
> some comments would be very welcome.
There are two cases where we want to do a partition re-read:
- in lookup(), if the entry was not found
- in readdir().
The point of this is to make sure that the partition list is updated
(if media has changed) whenever user-space might care. Without the
above code, if the media changes, and thus the partitioning changes,
the list of partitions that devfs has is stale. Two things (at least)
could go wrong in this case:
- ls on directory reports partitions that are no longer valid
- a new partition cannot be accessed because the entry hasn't been
registered yet.
The code prevents these problems.
Clear?
Regards,
Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-
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/