Merge lp:~laurynas-biveinis/percona-server/bug1262500-5.6 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 521
Merged at revision: 523
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1262500-5.6
Merge into: lp:percona-server/5.6
Diff against target: 36 lines (+7/-5)
1 file modified
Percona-Server/storage/innobase/os/os0file.cc (+7/-5)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1262500-5.6
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Registry Administrators Pending
Review via email: mp+199704@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

The patch looks correct, but see bug #1263087

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/os/os0file.cc'
2--- Percona-Server/storage/innobase/os/os0file.cc 2013-12-05 17:23:10 +0000
3+++ Percona-Server/storage/innobase/os/os0file.cc 2013-12-19 18:57:34 +0000
4@@ -2477,12 +2477,13 @@
5 os_mutex_exit(os_file_count_mutex);
6 #endif /* HAVE_ATOMIC_BUILTINS && UNIV_WORD == 8 */
7
8- /* Handle signal interruptions correctly */
9+ /* Handle partial reads and signal interruptions correctly */
10 for (n_bytes = 0; n_bytes < (ssize_t) n; ) {
11- n_read = pread(file, buf, (ssize_t)n, offs);
12+ n_read = pread(file, buf, (ssize_t)n - n_bytes, offs);
13 if (n_read > 0) {
14 n_bytes += n_read;
15 offs += n_read;
16+ buf = (char *)buf + n_read;
17 } else if (n_read == -1 && errno == EINTR) {
18 continue;
19 } else {
20@@ -2624,12 +2625,13 @@
21 MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_WRITES);
22 #endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD < 8 */
23
24- /* Handle signal interruptions correctly */
25+ /* Handle partial writes and signal interruptions correctly */
26 for (ret = 0; ret < (ssize_t) n; ) {
27- n_written = pwrite(file, buf, (ssize_t)n, offs);
28- if (n_written > 0) {
29+ n_written = pwrite(file, buf, (ssize_t)n - ret, offs);
30+ if (n_written >= 0) {
31 ret += n_written;
32 offs += n_written;
33+ buf = (char *)buf + n_written;
34 } else if (n_written == -1 && errno == EINTR) {
35 continue;
36 } else {

Subscribers

People subscribed via source and target branches