Messages in this thread | | | Date | Mon, 23 Jan 2006 21:48:11 +0100 | From | Pavel Machek <> | Subject | Re: [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/
| |