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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 612
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1262500-5.5
Merge into: lp:percona-server/5.5
Diff against target: 36 lines (+7/-5)
1 file modified
Percona-Server/storage/innobase/os/os0file.c (+7/-5)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1262500-5.5
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Registry Administrators Pending
Review via email: mp+199701@code.launchpad.net
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.c'
2--- Percona-Server/storage/innobase/os/os0file.c 2013-08-21 07:14:34 +0000
3+++ Percona-Server/storage/innobase/os/os0file.c 2013-12-19 18:53:56 +0000
4@@ -2365,12 +2365,13 @@
5 os_n_pending_reads++;
6 os_mutex_exit(os_file_count_mutex);
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@@ -2493,12 +2494,13 @@
21 os_n_pending_writes++;
22 os_mutex_exit(os_file_count_mutex);
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