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

Issue 2230713003: Store correct read-only flag of mounted disks. (Closed)

Created:
4 years, 4 months ago by yamaguchi
Modified:
4 years, 4 months ago
Reviewers:
hashimoto, satorux1, kinaba
CC:
chromium-reviews, oshima+watch_chromium.org, hashimoto+watch_chromium.org, fukino
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Store read-only flag of mounted disks. Chrome has been using the readonly field returned by GetDeviceProperties in cros_disks API to tell whether a disk device is wriatble or read-only. However, the field is based on the physical writablilty of the block device, not reflecting the "ro" flag passed to the mount command. This will be an issue once we introduce read-only mount policy. DiskMountManager needs to remember it because neither the "mount completed" and "disk profile got" DBus messages doesn't convey that information at the moment. TEST=chromeos_unittests, and manually see that Files app shows no-entry icon when you drag a file to an external storage device from Drive. Apply patch 2248033003 locally to simulate the external_storage_read_only option. BUG=629945, 640579 Committed: https://crrev.com/6594bf7e1c8d13f7d0ee2648698f11835d1a7733 Cr-Commit-Position: refs/heads/master@{#414169}

Patch Set 1 #

Total comments: 13

Patch Set 2 : Minor changes for local variable name and assertions in test. #

Patch Set 3 : Use device path as a key because mount_path is not given to DiskMountManager::MountPath #

Patch Set 4 : Sync to head. #

Total comments: 4

Patch Set 5 : Use source path of mount info directly to lookup. Comment update. #

Total comments: 1

Patch Set 6 : Provide updated disks_ to observers. #

Patch Set 7 : Add test to make sure observers can see updated disks. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -34 lines) Patch
M chromeos/dbus/fake_cros_disks_client.cc View 1 chunk +19 lines, -5 lines 0 comments Download
M chromeos/disks/disk_mount_manager.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chromeos/disks/disk_mount_manager.cc View 1 2 3 4 5 6 5 chunks +40 lines, -8 lines 0 comments Download
M chromeos/disks/disk_mount_manager_unittest.cc View 1 2 3 4 5 6 4 chunks +97 lines, -21 lines 1 comment Download

Messages

Total messages: 45 (23 generated)
yamaguchi
+hashimoto for dbus/ and the file system logic. +satorux for OWNERS review of disks/* .
4 years, 4 months ago (2016-08-10 11:17:02 UTC) #3
satorux1
Did you consider changing the cros-disks behavior instead? That might be a better approach. If ...
4 years, 4 months ago (2016-08-12 02:47:52 UTC) #5
hashimoto
I'm worried about this CL because the access mode map code is only needed by ...
4 years, 4 months ago (2016-08-15 06:45:12 UTC) #6
yamaguchi
On 2016/08/15 06:45:12, hashimoto wrote: > I'm worried about this CL because the access mode ...
4 years, 4 months ago (2016-08-15 08:01:45 UTC) #7
hashimoto
On 2016/08/15 08:01:45, yamaguchi wrote: > On 2016/08/15 06:45:12, hashimoto wrote: > > I'm worried ...
4 years, 4 months ago (2016-08-15 09:03:33 UTC) #8
yamaguchi
I agree that the best is to modify the API (cros_disks). I investigated and it'd ...
4 years, 4 months ago (2016-08-15 15:32:48 UTC) #10
satorux1
On 2016/08/15 15:32:48, yamaguchi wrote: > I agree that the best is to modify the ...
4 years, 4 months ago (2016-08-16 20:31:10 UTC) #12
yamaguchi
I would like to check in this fix first. Synced to head. PTAL. We are ...
4 years, 4 months ago (2016-08-23 05:06:44 UTC) #17
satorux1
Please also update TEST= line and describe how you can test this manually in Files ...
4 years, 4 months ago (2016-08-23 05:40:49 UTC) #21
yamaguchi
https://codereview.chromium.org/2230713003/diff/60001/chromeos/disks/disk_mount_manager.cc File chromeos/disks/disk_mount_manager.cc (right): https://codereview.chromium.org/2230713003/diff/60001/chromeos/disks/disk_mount_manager.cc#newcode369 chromeos/disks/disk_mount_manager.cc:369: AccessModeMap::iterator it = access_modes_.find(disk->device_path()); On 2016/08/23 05:40:49, satorux1 wrote: ...
4 years, 4 months ago (2016-08-23 08:08:53 UTC) #24
yamaguchi
I found this change sometimes don't work as intended. 1. Right after plugging a device, ...
4 years, 4 months ago (2016-08-24 00:41:26 UTC) #25
satorux1
On 2016/08/24 00:41:26, yamaguchi wrote: > I found this change sometimes don't work as intended. ...
4 years, 4 months ago (2016-08-24 01:36:32 UTC) #26
chromium-reviews
From what I could see so far, it's looks like not reflected to UI until ...
4 years, 4 months ago (2016-08-24 02:13:00 UTC) #27
yamaguchi
https://codereview.chromium.org/2230713003/diff/80001/chromeos/disks/disk_mount_manager.cc File chromeos/disks/disk_mount_manager.cc (right): https://codereview.chromium.org/2230713003/diff/80001/chromeos/disks/disk_mount_manager.cc#newcode343 chromeos/disks/disk_mount_manager.cc:343: NotifyMountStatusUpdate(MOUNTING, entry.error_code(), mount_info); This will invoke observer functions. Especially, ...
4 years, 4 months ago (2016-08-24 06:46:28 UTC) #28
yamaguchi
On 2016/08/24 06:46:28, yamaguchi wrote: > https://codereview.chromium.org/2230713003/diff/80001/chromeos/disks/disk_mount_manager.cc > File chromeos/disks/disk_mount_manager.cc (right): > > https://codereview.chromium.org/2230713003/diff/80001/chromeos/disks/disk_mount_manager.cc#newcode343 > ...
4 years, 4 months ago (2016-08-24 07:27:35 UTC) #29
satorux1
i'm running out of time today. hashimoto@ could you take a look?
4 years, 4 months ago (2016-08-24 07:32:46 UTC) #30
yamaguchi
+kinaba because hashimoto is OOO.
4 years, 4 months ago (2016-08-24 08:41:29 UTC) #32
yamaguchi
Updated test to cover the change. ptal.
4 years, 4 months ago (2016-08-24 10:13:15 UTC) #33
satorux1
LGTM https://codereview.chromium.org/2230713003/diff/120001/chromeos/disks/disk_mount_manager_unittest.cc File chromeos/disks/disk_mount_manager_unittest.cc (right): https://codereview.chromium.org/2230713003/diff/120001/chromeos/disks/disk_mount_manager_unittest.cc#newcode676 chromeos/disks/disk_mount_manager_unittest.cc:676: [&]() { ExpectDiskReadOnly(manager, kSourcePath2, true); })); hmm, this ...
4 years, 4 months ago (2016-08-24 22:05:50 UTC) #39
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/2230713003/120001
4 years, 4 months ago (2016-08-24 22:09:53 UTC) #41
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-24 22:16:52 UTC) #43
commit-bot: I haz the power
4 years, 4 months ago (2016-08-24 22:20:27 UTC) #45
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6594bf7e1c8d13f7d0ee2648698f11835d1a7733
Cr-Commit-Position: refs/heads/master@{#414169}

Powered by Google App Engine
This is Rietveld 408576698