Skip to content

adfs: reject disc records smaller than one filesystem block

Samuel Moelius lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- Split the selftest into a separate patch.
- Added a tools/testing/selftests/filesystems/adfs test target.
- Added generated-good-image and generated-bad-image mount validation.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2adfs: reject disc records smaller than one filesystem blockfs/adfs/super.c+4 -05 replies
2/2selftests: filesystems: add ADFS mount validation testtools/testing/selftests/Makefile tools/testing/selftests/filesystems/adfs/Makefile tools/testing/selftests/filesystems/adfs/adfs_mount_check.sh +1 more+121 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] adfs: reject disc records smaller than one filesystem block

Hi,

This v2 splits the ADFS fix and the requested selftest into separate patches.

Patch 1 rejects ADFS disc records whose declared disc size is smaller than one filesystem block. Such an image can otherwise mount and later hit a divide-by-zero in statfs because f_blocks is zero.

Patch 2 adds a filesystems/adfs selftest that generates two minimal ADFS
images: a valid image with a one-block disc size, and an otherwise identical invalid image whose disc size is smaller than one filesystem block. The test verifies that the valid image mounts and statfs succeeds, and that the invalid image is rejected at mount time.

Changes since v1:
- Split the selftest into a separate patch.
- Added a tools/testing/selftests/filesystems/adfs test target.
- Added generated-good-image and generated-bad-image mount validation.

Thanks,
Sam

Samuel Moelius (2):
adfs: reject disc records smaller than one filesystem block
selftests: filesystems: add ADFS mount validation test

 fs/adfs/super.c                               |   4 +
 tools/testing/selftests/Makefile              |   1 +
 .../selftests/filesystems/adfs/Makefile       |   5 +
 .../filesystems/adfs/adfs_mount_check.sh      | 113 ++++++++++++++++++
 .../testing/selftests/filesystems/adfs/config |   2 +
 5 files changed, 125 insertions(+)
 create mode 100644 tools/testing/selftests/filesystems/adfs/Makefile
 create mode 100755 tools/testing/selftests/filesystems/adfs/adfs_mount_check.sh
 create mode 100644 tools/testing/selftests/filesystems/adfs/config
Signature · 1 line
2.43.0