https://github.com/torvalds/linux
Revision 0d200aefd4ac51787b6b80de1bb7ce93bccd59f6 authored by Joe Thornber on 03 July 2012, 11:55:31 UTC, committed by Alasdair G Kergon on 03 July 2012, 11:55:31 UTC
Userland sometimes sees a corrupt metadata block if metadata is changing
rapidly when a metadata snapshot is reserved for userland,  To make the
problem go away, commit before we take the metadata snapshot (which is a
sensible thing to do anyway).

The checksums mean userland spots this corruption immediately so there's
no risk of acting on incorrect data.  No corruption exists from the
kernel's point of view, and thin_check passes after pool shutdown.

I believe this is to do with shared blocks at the first level of the
{device, mapping} btree.  Prior to the metadata-snap support no sharing
at this level was possible, so this patch is only required after commit
cc8394d86f045b86ff303d3c9e4ce47d97148951 ("dm thin: provide userspace
access to pool metadata").

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent 6887a41
Raw File
Tip revision: 0d200aefd4ac51787b6b80de1bb7ce93bccd59f6 authored by Joe Thornber on 03 July 2012, 11:55:31 UTC
dm thin: commit metadata before creating metadata snapshot
Tip revision: 0d200ae
ad1843.h
/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright 2003 Vivien Chappelier <vivien.chappelier@linux-mips.org>
 * Copyright 2008 Thomas Bogendoerfer <tsbogend@franken.de>
 */

#ifndef __SOUND_AD1843_H
#define __SOUND_AD1843_H

struct snd_ad1843 {
	void *chip;
	int (*read)(void *chip, int reg);
	int (*write)(void *chip, int reg, int val);
};

#define AD1843_GAIN_RECLEV 0
#define AD1843_GAIN_LINE   1
#define AD1843_GAIN_LINE_2 2
#define AD1843_GAIN_MIC    3
#define AD1843_GAIN_PCM_0  4
#define AD1843_GAIN_PCM_1  5
#define AD1843_GAIN_SIZE   (AD1843_GAIN_PCM_1+1)

int ad1843_get_gain_max(struct snd_ad1843 *ad1843, int id);
int ad1843_get_gain(struct snd_ad1843 *ad1843, int id);
int ad1843_set_gain(struct snd_ad1843 *ad1843, int id, int newval);
int ad1843_get_recsrc(struct snd_ad1843 *ad1843);
int ad1843_set_recsrc(struct snd_ad1843 *ad1843, int newsrc);
void ad1843_setup_dac(struct snd_ad1843 *ad1843,
		      unsigned int id,
		      unsigned int framerate,
		      snd_pcm_format_t fmt,
		      unsigned int channels);
void ad1843_shutdown_dac(struct snd_ad1843 *ad1843,
			 unsigned int id);
void ad1843_setup_adc(struct snd_ad1843 *ad1843,
		      unsigned int framerate,
		      snd_pcm_format_t fmt,
		      unsigned int channels);
void ad1843_shutdown_adc(struct snd_ad1843 *ad1843);
int ad1843_init(struct snd_ad1843 *ad1843);

#endif /* __SOUND_AD1843_H */
back to top