summaryrefslogtreecommitdiff
path: root/fs_mgr/libdm/loop_control.cpp
AgeCommit message (Collapse)Author
2019-10-01Fix fds libdm_testYifan Hong
Failed because of double free of fds. Test: run it Change-Id: I25d7d590ca52d57fb14a5483ff8751127f6a48a6
2019-07-11libdm: Fix race conditions in LoopControl::Attach.David Anderson
This fixes two race conditions in LoopControl::Attach(). The first is that after LOOP_CTL_GET_FREE, the path is not be available until it has been processed by ueventd. This can be fixed by adding a timeout parameter and a call to WaitForFile(). Second, it is possible (albeit unlikely), given that loop devices are now being used more aggressively, that two processes race when attempting LOOP_SET_FD. In this case, one process will win, and the other will fail with EBUSY. We can handle this case by retrying the operation while respecting the same timeout parameter. Bug: 135771280 Test: libdm_test gtest Change-Id: Icf9facc3ca28fdb6ff5c78612d3dc183fa47b1f3
2019-06-19libdm: Add LoopControl helpers for enabling direct IO.David Anderson
Bug: 134536978 Test: manual test Change-Id: Iae25434ac54186fd6006b56eeb7a7f577a880053
2018-06-25libdm: Add helper classes for loop control.David Anderson
This change adds a LoopControl class for interacting with the loop control device. In addition it provides a LoopDevice class for creating temporary loop devices. This is aimed at being a building block for libdm tests, so the current functionality is limited to attaching and detaching file descriptors and finding free loop devices. Bug: 110035986 Test: libdm_test gtest Change-Id: Ice2891e3a44a037aff7b81c63ac793815640d582