Merge lp:~gl-az/percona-xtrabackup/2.1-bug1190610 into lp:percona-xtrabackup/2.1

Proposed by George Ormond Lorch III
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 615
Proposed branch: lp:~gl-az/percona-xtrabackup/2.1-bug1190610
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 51 lines (+5/-5)
3 files modified
src/xbcrypt.c (+2/-2)
src/xbcrypt.h (+1/-1)
src/xbcrypt_read.c (+2/-2)
To merge this branch: bzr merge lp:~gl-az/percona-xtrabackup/2.1-bug1190610
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+170221@code.launchpad.net

Description of the change

Fix for bug 1190610 : Decryption fails at a later stage.

xbcrypt_read_chunk was relying on blocking/full I/O even though it didn't
specify MY_FULL_IO during the bulk data read. Added ability to pass
desired flags down through read mechanism callback so that header reads
can fail on EOF and bulk data can block until data is available.

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/xbcrypt.c'
2--- src/xbcrypt.c 2013-03-11 19:11:29 +0000
3+++ src/xbcrypt.c 2013-06-18 23:25:32 +0000
4@@ -280,10 +280,10 @@
5
6 static
7 ssize_t
8-my_xb_crypt_read_callback(void *userdata, void *buf, size_t len)
9+my_xb_crypt_read_callback(void *userdata, void *buf, size_t len, int flags)
10 {
11 File* file = (File *) userdata;
12- return my_read(*file, buf, len, MYF(MY_WME));
13+ return my_read(*file, buf, len, flags);
14 }
15
16 static
17
18=== modified file 'src/xbcrypt.h'
19--- src/xbcrypt.h 2013-03-11 19:11:29 +0000
20+++ src/xbcrypt.h 2013-06-18 23:25:32 +0000
21@@ -53,7 +53,7 @@
22
23 /* Callback on write for i/o, must return # of bytes read or -1 on error */
24 typedef ssize_t xb_crypt_read_callback(void *userdata,
25- void *buf, size_t len);
26+ void *buf, size_t len, int flags);
27
28 xb_rcrypt_t *xb_crypt_read_open(void *userdata,
29 xb_crypt_read_callback *onread);
30
31=== modified file 'src/xbcrypt_read.c'
32--- src/xbcrypt_read.c 2013-03-11 19:11:29 +0000
33+++ src/xbcrypt_read.c 2013-06-18 23:25:32 +0000
34@@ -56,7 +56,7 @@
35 ssize_t bytesread;
36 xb_rcrypt_result_t result = XB_CRYPT_READ_CHUNK;
37
38- if ((bytesread = crypt->read(crypt->userdata, tmpbuf, sizeof(tmpbuf)))
39+ if ((bytesread = crypt->read(crypt->userdata, tmpbuf, sizeof(tmpbuf), MYF(MY_WME)))
40 != sizeof(tmpbuf)) {
41 if (bytesread == 0) {
42 result = XB_CRYPT_READ_EOF;
43@@ -138,7 +138,7 @@
44 }
45
46 if (*elen > 0) {
47- if (crypt->read(crypt->userdata, crypt->buffer, *elen)
48+ if (crypt->read(crypt->userdata, crypt->buffer, *elen, MYF(MY_WME|MY_FULL_IO))
49 != (ssize_t)*elen) {
50 msg("%s:%s: failed to read %lld bytes for chunk payload "
51 "at offset 0x%llx.\n", my_progname, __FUNCTION__,

Subscribers

People subscribed via source and target branches