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

Issue 2198283002: Return correct disk free/available size when FS is mounted with size = 0 (Closed)

Created:
4 years, 4 months ago by Sriram
Modified:
4 years, 4 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Return correct disk free/available size when FS is mounted with size = 0 When tmpfs is mounted with size = 0 (i.e. without any limit), then statvfs will return 0 for f_bfree, f_bavail, and f_blocks. Catch this case and return max_int64 instead. Also switch to using statfs() instead of statvfs() as f_type is not exposed via latter. BUG=628710 Committed: https://crrev.com/9bbda42930813a781a034c378e1bcfbe90d503f8 Cr-Commit-Position: refs/heads/master@{#409358}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Switch to statfs() instead of statvfs() as f_type is not exposed via latter. #

Total comments: 3

Patch Set 3 : Fix include for Mac OS X #

Patch Set 4 : Call statfs only in Linux. #

Total comments: 1

Patch Set 5 : Update based on CR comment and fix try bot failure. #

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

Messages

Total messages: 33 (21 generated)
Sriram
4 years, 4 months ago (2016-08-01 20:43:07 UTC) #2
Lei Zhang
https://codereview.chromium.org/2198283002/diff/1/base/sys_info_posix.cc File base/sys_info_posix.cc (right): https://codereview.chromium.org/2198283002/diff/1/base/sys_info_posix.cc#newcode98 base/sys_info_posix.cc:98: stats.f_blocks == 0 && IsStatsZeroIfUnlimited(stats.f_fsid); Are you sure f_fsid ...
4 years, 4 months ago (2016-08-01 21:30:55 UTC) #3
Sriram
https://codereview.chromium.org/2198283002/diff/1/base/sys_info_posix.cc File base/sys_info_posix.cc (right): https://codereview.chromium.org/2198283002/diff/1/base/sys_info_posix.cc#newcode98 base/sys_info_posix.cc:98: stats.f_blocks == 0 && IsStatsZeroIfUnlimited(stats.f_fsid); On 2016/08/01 21:30:55, Lei ...
4 years, 4 months ago (2016-08-02 00:03:24 UTC) #7
Lei Zhang
You've got red bots. https://codereview.chromium.org/2198283002/diff/20001/base/sys_info_posix.cc File base/sys_info_posix.cc (left): https://codereview.chromium.org/2198283002/diff/20001/base/sys_info_posix.cc#oldcode24 base/sys_info_posix.cc:24: #if defined(OS_ANDROID) Ok, hope this ...
4 years, 4 months ago (2016-08-02 00:11:48 UTC) #10
Lei Zhang
Now I suspect the reason statvfs was used is because of Mac. I think it's ...
4 years, 4 months ago (2016-08-02 19:15:19 UTC) #15
Sriram
On 2016/08/02 19:15:19, Lei Zhang wrote: > Now I suspect the reason statvfs was used ...
4 years, 4 months ago (2016-08-02 19:32:45 UTC) #17
Lei Zhang
lgtm https://codereview.chromium.org/2198283002/diff/50001/base/sys_info_posix.cc File base/sys_info_posix.cc (right): https://codereview.chromium.org/2198283002/diff/50001/base/sys_info_posix.cc#newcode33 base/sys_info_posix.cc:33: #include <linux/magic.h> alphabetical order
4 years, 4 months ago (2016-08-02 19:35:41 UTC) #19
Sriram
https://codereview.chromium.org/2198283002/diff/20001/base/sys_info_posix.cc File base/sys_info_posix.cc (left): https://codereview.chromium.org/2198283002/diff/20001/base/sys_info_posix.cc#oldcode24 base/sys_info_posix.cc:24: #if defined(OS_ANDROID) On 2016/08/02 00:11:48, Lei Zhang wrote: > ...
4 years, 4 months ago (2016-08-02 20:51:56 UTC) #24
Lei Zhang
++lgtm
4 years, 4 months ago (2016-08-02 20:53:26 UTC) #25
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/2198283002/70001
4 years, 4 months ago (2016-08-02 22:38:55 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:70001)
4 years, 4 months ago (2016-08-02 22:42:50 UTC) #31
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 22:46:02 UTC) #33
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/9bbda42930813a781a034c378e1bcfbe90d503f8
Cr-Commit-Position: refs/heads/master@{#409358}

Powered by Google App Engine
This is Rietveld 408576698