Re: [PATCH 9/9] device-mapper snapshot: fix invalidation

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

 



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 <[email protected]>

> +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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux