[dm-devel] [PATCH 1/2] dm-snapshot: suspend origin when doing exception handover

Mikulas Patocka mpatocka at redhat.com
Fri Feb 27 19:20:31 UTC 2015



On Thu, 26 Feb 2015, Mikulas Patocka wrote:

> In the function snapshot_resume we perform exception store handover. If
> there is another active snapshot target, the exception store is moved from
> this target to the target that is being resume.
> 
> The problem is that if there is some pending exception, it will point to
> an incorrect exception store after that handover, causing crash in BUG in
> dm-snap-persistent.c:get_exception - see bug 1177389.
> 
> This bug can be triggered by repeatedly changing snapshot permissions with
> "lvchange -p r" and "lvchange -p rw" while there are writes on the
> associated origin device.
> 
> To fix this bug, we must suspend the origin device when doing the
> exception store handover to make sure that there is no pending exception.
> 
> This patch:
> - introdices _origin_hash that keeps track of dm_origin structures.
> - introduces function __lookup_dm_origin, __insert_dm_origin and
>   __remove_dm_origin that manipulate the origin hash.
> - modifies snapshot_resume so that it calls dm_internal_suspend_fast and
>   dm_internal_resume_fast on the origin device.
> 
> Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

I forgot to add

Cc: stable at vger.kernel.org

Note to people who backport it:

When backporting to kernels 3.12-3.18, use dm_internal_suspend and 
dm_internal_resume instead of dm_internal_suspend_fast and 
dm_internal_resume_fast.

When backporting to kernels older than 3.12, you need to pick functions 
dm_internal_suspend and dm_internal_resume from the patch 
fd2ed4d252701d3bbed4cd3e3d267ad469bb832a.

Mikulas




More information about the dm-devel mailing list