[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [PATCH] dm: also check for conflicting table type in dm_table_set_type
- From: Kiyoshi Ueda <k-ueda ct jp nec com>
- To: Mike Snitzer <snitzer redhat com>
- Cc: dm-devel redhat com
- Subject: Re: [dm-devel] [PATCH] dm: also check for conflicting table type in dm_table_set_type
- Date: Fri, 21 May 2010 18:01:06 +0900
Hi Mike,
On 05/21/2010 07:26 AM +0900, Mike Snitzer wrote:
> Factorize live table type compatibility check into
> dm_table_type_matches_live_table(). Catching a conflicting table type
> early, during table load, avoids failing during resume -- which always
> leaves the DM device suspended.
>
> So also check type during dm_table_set_type() -- which happens as part
> of a table load. But preserve the existing check during resume, in
> dm_swap_table(), because a racing table load could stage an inactive
> table that conflicts with the table type that dm_swap_table() is about
> to make live:
As you noted, the additional check in dm_table_set_type() is racy and
has no guarantee to detect problematic table loading in some cases.
Although I'm not sure such a duplicated racy check is really needed,
it will detect most cases and users may be happy with that.
So I have no objection, but at least, please put some comments that
it's racy in the code below.
> +finish:
> + if (!dm_table_type_matches_live_table(t))
> + return -EINVAL;
> +
Thanks,
Kiyoshi Ueda
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]