[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [PATCH v4 1/2] dm: prevent table type changes after initial table load



On Thu, May 27, 2010 at 08:47:48AM -0400, Mike Snitzer wrote:
> Introduce 'type_lock' in mapped_device structure and use it to protect
> md->type access.  table_load() sets md->type without concern for:

> - another table_load() racing to set conflicting md->type.
which leads to non-deterministic behaviour that is of no practical use and
so there is no need to support it.

> - do_resume() making a conflicting table live.
Any table being made live must already have passed through table_load so I
don't see how there can be conflicting types.

The mutex here seems to be overkill: instead of protecting one field to
cope with a useless race, we should be making the output of the race
deterministic (e.g. perhaps giving an error on the parallel table_load
attempt).

Anyway, I can take this patch for now and we can deal with the mutex/race
differently later.

Alasdair
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]