Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Issue 2860943005: Ensure that memory-maped files are fully realized. (Closed)

Created:
3 years, 7 months ago by bcwhite
Modified:
3 years, 7 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that memory-maped files are fully realized. Memory-mapped files cause crashes if there are I/O problems. By ensuring that the file is fully realized on disk, we eliminate a disk-full condition from causing a crash down the road. BUG=715523, 717331 Review-Url: https://codereview.chromium.org/2860943005 Cr-Commit-Position: refs/heads/master@{#471056} Committed: https://chromium.googlesource.com/chromium/src/+/e41b5ce8a877875575ad0c370bd4bdc8593113b2

Patch Set 1 #

Patch Set 2 : fix cross-platform build problems #

Total comments: 10

Patch Set 3 : do manual extension on older Android #

Patch Set 4 : fix other build problems #

Total comments: 2

Patch Set 5 : addressed review comments by mark #

Total comments: 2

Patch Set 6 : use existing_byte for write #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -4 lines) Patch
M base/files/memory_mapped_file_posix.cc View 1 2 3 4 5 3 chunks +62 lines, -4 lines 0 comments Download

Messages

Total messages: 66 (50 generated)
bcwhite
3 years, 7 months ago (2017-05-04 19:43:38 UTC) #4
Mark Mentovai
+primiano for the filesystem question https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc#newcode95 base/files/memory_mapped_file_posix.cc:95: if (!file_.SetLength(std::max(file_len, region.offset + ...
3 years, 7 months ago (2017-05-04 21:00:47 UTC) #16
bcwhite
https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc#newcode107 base/files/memory_mapped_file_posix.cc:107: // Android doesn't support the POSIX call so use ...
3 years, 7 months ago (2017-05-05 15:48:00 UTC) #17
Mark Mentovai
I guess so. Can we use linux-syscall-support in here for that?
3 years, 7 months ago (2017-05-05 15:56:24 UTC) #18
Primiano Tucci (use gerrit)
Filling the file seems the less controversial proposal. My only comment is that you should ...
3 years, 7 months ago (2017-05-05 16:23:33 UTC) #19
bcwhite
On 2017/05/05 15:56:24, Mark Mentovai wrote: > I guess so. Can we use linux-syscall-support in ...
3 years, 7 months ago (2017-05-05 16:24:08 UTC) #20
Mark Mentovai
#include <android/api-level.h> and use the __ANDROID_API__ macro. If it’s >= 21, fallocate() will be available. ...
3 years, 7 months ago (2017-05-05 16:43:25 UTC) #21
bcwhite
https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/40001/base/files/memory_mapped_file_posix.cc#newcode95 base/files/memory_mapped_file_posix.cc:95: if (!file_.SetLength(std::max(file_len, region.offset + region.size))) { On 2017/05/04 21:00:47, ...
3 years, 7 months ago (2017-05-05 18:06:59 UTC) #44
Mark Mentovai
https://codereview.chromium.org/2860943005/diff/180001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/180001/base/files/memory_mapped_file_posix.cc#newcode135 base/files/memory_mapped_file_posix.cc:135: if (i > original_file_len) { I don’t see anything ...
3 years, 7 months ago (2017-05-05 18:31:44 UTC) #45
Primiano Tucci (use gerrit)
> I think you should have a fallback based on unlink & write zeros. Or ...
3 years, 7 months ago (2017-05-05 18:53:55 UTC) #46
bcwhite
> Or just return failure here and fall back not using a > mmapped file ...
3 years, 7 months ago (2017-05-08 14:15:36 UTC) #50
bcwhite
Ping?
3 years, 7 months ago (2017-05-10 17:54:57 UTC) #54
Mark Mentovai
LGTM! https://codereview.chromium.org/2860943005/diff/200001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/200001/base/files/memory_mapped_file_posix.cc#newcode140 base/files/memory_mapped_file_posix.cc:140: if (pwrite(file_.GetPlatformFile(), "", 1, i) != 1) You ...
3 years, 7 months ago (2017-05-10 19:10:14 UTC) #55
bcwhite
https://codereview.chromium.org/2860943005/diff/200001/base/files/memory_mapped_file_posix.cc File base/files/memory_mapped_file_posix.cc (right): https://codereview.chromium.org/2860943005/diff/200001/base/files/memory_mapped_file_posix.cc#newcode140 base/files/memory_mapped_file_posix.cc:140: if (pwrite(file_.GetPlatformFile(), "", 1, i) != 1) On 2017/05/10 ...
3 years, 7 months ago (2017-05-11 19:34:13 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860943005/220001
3 years, 7 months ago (2017-05-11 20:14:41 UTC) #63
commit-bot: I haz the power
3 years, 7 months ago (2017-05-11 20:28:07 UTC) #66
Message was sent while issue was closed.
Committed patchset #6 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/e41b5ce8a877875575ad0c370bd4...

Powered by Google App Engine
This is Rietveld 408576698