Skip to content

tst_device.c: Handle Android path for backing device

Edward Liaw via ltp ltp 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyIn review
  2. v34 patches 5 repliesSuperseded
  3. v23 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches0 repliesSuperseded

Changes in v4 from the cover letter

Rename dev_len argument to dev_size and update documentation and references. Remove != 0 as it is redundant.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4set_dev_path: Rename to set_dev_loop_pathlib/tst_device.c+6 -60 replies
2/4set_dev_loop_path: Change return value to zero on successlib/tst_device.c+3 -30 replies
3/4tst_find_free_loopdev: Check return value of set_dev_loop_pathlib/tst_device.c+2 -20 replies
4/4tst_find_backing_dev: Also check /dev/block/ for backing devicedoc/c-test-api.txt include/tst_device.h lib/newlib_tests/tst_device.c +2 more+33 -170 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchPetr VorelCyril Hrubis
1/4R-b
2/4R-b
3/4R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [LTP] [PATCH v4 0/4] tst_device.c: Handle Android path for backing device

e1b1ae66b240 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent") added a hardcoded path to check for the backing device in /dev. On Android, it needs to check /dev/block.

The set_dev_path function was renamed to set_dev_loop_path and its return value was changed from 1 on success to 0 on success to be more consistent with other functions. A check was added to tst_find_free_loopdev in the event that the loop device is not ready yet, which appears to happen occasionally on Android.

v1->v2:
Changed the function signature of tst_find_backing_dev to add the length of the path string. Updated all references for this function to include the added parameter.

v2->v3:
Split the function rename, return value change, and the return value check into 3 commits. Fixed logic for non-NULL path check. Added Fixes tag for e1b1ae66b240.

v3->v4:
Rename dev_len argument to dev_size and update documentation and references. Remove != 0 as it is redundant.

Edward Liaw (4):
set_dev_path: Rename to set_dev_loop_path
set_dev_loop_path: Change return value to zero on success
tst_find_free_loopdev: Check return value of set_dev_loop_path
tst_find_backing_dev: Also check /dev/block/ for backing device

 doc/c-test-api.txt                            |  2 +-
 include/tst_device.h                          |  7 +--
 lib/newlib_tests/tst_device.c                 |  2 +-
 lib/tst_device.c                              | 51 ++++++++++++-------
 .../kernel/syscalls/ioctl/ioctl_loop05.c      |  2 +-
 5 files changed, 40 insertions(+), 24 deletions(-)
Signature · 5 lines
2.40.0.348.gf938b09366-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp