Skip to content

Commit 4ba3471

Browse files
mcgrofkawasaki
authored andcommitted
common/xfs: add _test_dev_suits_xfs() to verify logical block size will work
mkfs.xfs will use the sector size exposed by the device, if this is larger than 32k this will fail as the largest sector size on XFS is 32k. Provide a sanity check to ensure we skip creating a filesystem if the sector size is larger than what XFS supports. Suggested-by: Shinichiro Kawasaki <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]> [Shin'ichiro: drop changes for block/032 and nvme/012] Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 71f5a5c commit 4ba3471

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

common/xfs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ _have_xfs() {
2626
_have_fs xfs && _have_program mkfs.xfs
2727
}
2828

29+
_test_dev_suits_xfs() {
30+
local logical_block_size
31+
32+
logical_block_size=$(_test_dev_queue_get logical_block_size)
33+
if ((logical_block_size > 32768 )); then
34+
SKIP_REASONS+=("sector size ${logical_block_size} is larger than max XFS sector size 32768")
35+
return 1
36+
fi
37+
return 0
38+
}
39+
2940
_xfs_mkfs_and_mount() {
3041
local bdev=$1
3142
local mount_dir=$2

tests/nvme/035

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ requires() {
1919
device_requires() {
2020
_require_test_dev_is_not_nvme_multipath
2121
_require_test_dev_size "${NVME_IMG_SIZE}"
22+
_test_dev_suits_xfs
2223
}
2324

2425
set_conditions() {

0 commit comments

Comments
 (0)