lkml.org 
[lkml]   [2006]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 9/9] device-mapper snapshot: fix invalidation
On Pá 20-01-06 21:34:57, Alasdair G Kergon wrote:
> When a snapshot becomes invalid, s->valid is set to 0.
> In this state, a snapshot can no longer be accessed.
>
> When s->lock is acquired, before doing anything else, s->valid must be
> checked to ensure the snapshot remains valid.
>
> This patch eliminates some races (that may cause panics) by adding
> some missing checks. At the same time, some unnecessary levels of
> indentation are removed and snapshot invalidation is moved into a
> single function that always generates a device-mapper event.
>
> Signed-Off-By: Alasdair G Kergon <agk@redhat.com>

> +static void __invalidate_snapshot(struct dm_snapshot *s, struct pending_exception *pe, int err)
> +{
> + if (!s->valid)
> + return;
> +
> + if ((err == -EIO))
> + DMERR("Invalidating snapshot: Error reading/writing.");
> + else if ((err == -ENOMEM))

I see you are trying to make it look distinct from assignment,
but... please don't do this.
Pavel

--
Thanks, Sharp!
-
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/

\
 
 \ /
  Last update: 2006-01-23 21:50    [W:0.041 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site