summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-wiimote.h
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2013-11-29 18:13:37 -0500
committerMike Snitzer <snitzer@redhat.com>2013-12-10 16:34:25 -0500
commit230c83afdd9cd384348475bea1e14b80b3b6b1b8 (patch)
tree79bc088357ce162090d9aaafd6d4ef2df0354f37 /drivers/hid/hid-wiimote.h
parent718822c1c112dc99e0c72c8968ee1db9d9d910f0 (diff)
dm snapshot: avoid snapshot space leak on crash
There is a possible leak of snapshot space in case of crash. The reason for space leaking is that chunks in the snapshot device are allocated sequentially, but they are finished (and stored in the metadata) out of order, depending on the order in which copying finished. For example, supposed that the metadata contains the following records SUPERBLOCK METADATA (blocks 0 ... 250) DATA 0 DATA 1 DATA 2 ... DATA 250 Now suppose that you allocate 10 new data blocks 251-260. Suppose that copying of these blocks finish out of order (block 260 finished first and the block 251 finished last). Now, the snapshot device looks like this: SUPERBLOCK METADATA (blocks 0 ... 250, 260, 259, 258, 257, 256) DATA 0 DATA 1 DATA 2 ... DATA 250 DATA 251 DATA 252 DATA 253 DATA 254 DATA 255 METADATA (blocks 255, 254, 253, 252, 251) DATA 256 DATA 257 DATA 258 DATA 259 DATA 260 Now, if the machine crashes after writing the first metadata block but before writing the second metadata block, the space for areas DATA 250-255 is leaked, it contains no valid data and it will never be used in the future. This patch makes dm-snapshot complete exceptions in the same order they were allocated, thus fixing this bug. Note: when backporting this patch to the stable kernel, change the version field in the following way: * if version in the stable kernel is {1, 11, 1}, change it to {1, 12, 0} * if version in the stable kernel is {1, 10, 0} or {1, 10, 1}, change it to {1, 10, 2} Userspace reads the version to determine if the bug was fixed, so the version change is needed. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/hid/hid-wiimote.h')
0 files changed, 0 insertions, 0 deletions