Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 412972 Details for
Bug 561558
>=sys-kernel/gentoo-sources-4.0.0 can lead to data corruption with dm-crypt on certain ssds
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dm crypt: constrain crypt device's max_segment_size to PAGE_SIZE
file_561558.txt (text/plain), 1.64 KB, created by
kipplasterjoe
on 2015-09-26 12:55:13 UTC
(
hide
)
Description:
dm crypt: constrain crypt device's max_segment_size to PAGE_SIZE
Filename:
MIME Type:
Creator:
kipplasterjoe
Created:
2015-09-26 12:55:13 UTC
Size:
1.64 KB
patch
obsolete
>diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c >index 76f1d6e..f717762 100644 >--- a/drivers/md/dm-crypt.c >+++ b/drivers/md/dm-crypt.c >@@ -973,7 +973,8 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone); > > /* > * Generate a new unfragmented bio with the given size >- * This should never violate the device limitations >+ * This should never violate the device limitations (but only because >+ * max_segment_size is being constrained to PAGE_SIZE). > * > * This function may be called concurrently. If we allocate from the mempool > * concurrently, there is a possibility of deadlock. For example, if we have >@@ -2057,9 +2058,20 @@ static int crypt_iterate_devices(struct dm_target *ti, > return fn(ti, cc->dev, cc->start, ti->len, data); > } > >+static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) >+{ >+ /* >+ * Unfortunate constraint that is required to avoid the potential >+ * for exceeding underlying device's max_segments limits -- due to >+ * crypt_alloc_buffer() possibly allocating pages for the encryption >+ * bio that are not as physically contiguous as the original bio. >+ */ >+ limits->max_segment_size = PAGE_SIZE; >+} >+ > static struct target_type crypt_target = { > .name = "crypt", >- .version = {1, 14, 0}, >+ .version = {1, 14, 1}, > .module = THIS_MODULE, > .ctr = crypt_ctr, > .dtr = crypt_dtr, >@@ -2071,6 +2083,7 @@ static struct target_type crypt_target = { > .message = crypt_message, > .merge = crypt_merge, > .iterate_devices = crypt_iterate_devices, >+ .io_hints = crypt_io_hints, > }; > > static int __init dm_crypt_init(void) >-- >1.7.4.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 561558
: 412972