요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Error와 corruption feature
dm-flakey.rst:37-88Read/write failure·drop, fixed byte와 random corruption 및 bio flag 예제를 정리합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=========
dm-flakey
=========
This target is the same as the linear target except that it exhibits
unreliable behaviour periodically. It's been found useful in simulating
failing devices for testing purposes.
Starting from the time the table is loaded, the device is available for
<up interval> seconds, then exhibits unreliable behaviour for <down
interval> seconds, and then this cycle repeats.
Also, consider using this in combination with the dm-delay target too,
which can delay reads and writes and/or send them to different
underlying devices.
Table parameters
----------------
::
<dev path> <offset> <up interval> <down interval> \
[<num_features> [<feature arguments>]]
Mandatory parameters:
<dev path>:
Full pathname to the underlying block-device, or a
"major:minor" device-number.
<offset>:
Starting sector within the device.
<up interval>:
Number of seconds device is available.
<down interval>:
Number of seconds device returns errors.
Optional feature parameters:
If no feature parameters are present, during the periods of
unreliability, all I/O returns errors.
error_reads:
All read I/O is failed with an error signalled.
Write I/O is handled correctly.
drop_writes:
All write I/O is silently ignored.
Read I/O is handled correctly.
error_writes:
All write I/O is failed with an error signalled.
Read I/O is handled correctly.
corrupt_bio_byte <Nth_byte> <direction> <value> <flags>:
During <down interval>, replace <Nth_byte> of the data of
each matching bio with <value>.
<Nth_byte>:
The offset of the byte to replace.
Counting starts at 1, to replace the first byte.
<direction>:
Either 'r' to corrupt reads or 'w' to corrupt writes.
'w' is incompatible with drop_writes.
<value>:
The value (from 0-255) to write.
<flags>:
Perform the replacement only if bio->bi_opf has all the
selected flags set.
random_read_corrupt <probability>
During <down interval>, replace random byte in a read bio
with a random value. probability is an integer between
0 and 1000000000 meaning 0% to 100% probability of corruption.
random_write_corrupt <probability>
During <down interval>, replace random byte in a write bio
with a random value. probability is an integer between
0 and 1000000000 meaning 0% to 100% probability of corruption.
Examples:
Replaces the 32nd byte of READ bios with the value 1::
corrupt_bio_byte 32 r 1 0
Replaces the 224th byte of REQ_META (=32) bios with the value 0::
corrupt_bio_byte 224 w 0 32
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
주기적으로 unreliable한 linear mapping
1-16`dm-flakey` target은 linear target과 같지만 주기적으로 unreliable behavior를 보입니다. Failure device를 simulation하는 test에 유용합니다.
Table을 load한 시점부터 device는 `<up interval>`초 동안 정상 사용 가능하고, 이어서 `<down interval>`초 동안 unreliable하게 동작합니다. 이 cycle을 계속 반복합니다.
Read와 write를 지연시키거나 서로 다른 underlying device로 보낼 수 있는 `dm-delay` target과 조합하는 방법도 고려할 수 있습니다.
Table load 시점을 기준으로 정상 구간과 failure injection 구간이 반복됩니다.
Table과 mandatory parameter
17-36dm-flakey table 형식은 다음과 같습니다.
<dev path> <offset> <up interval> <down interval> \
[<num_features> [<feature arguments>]]
Backing mapping과 정상·failure 시간 구간을 지정합니다.
Failure와 data corruption feature
37-79Feature parameter가 없으면 unreliable 구간에 모든 I/O가 error를 반환합니다.
Read 또는 write만 선택적으로 실패시키거나 write를 조용히 버립니다.
`corrupt_bio_byte <Nth_byte> <direction> <value> <flags>`는 down interval 동안 조건에 맞는 bio data의 `<Nth_byte>`를 `<value>`로 바꿉니다.
Byte 위치, I/O 방향, 대체 값과 bio flag 조건을 지정합니다.
`random_read_corrupt <probability>`는 down interval의 read bio에서 임의 byte를 임의 값으로 바꿉니다. `random_write_corrupt <probability>`는 write bio에 같은 동작을 합니다.
두 random corruption option의 probability는 0에서 `1000000000` 사이 정수이며 각각 0%에서 100% corruption 확률을 뜻합니다.
Down interval과 direction·flag 또는 probability 조건이 맞을 때 bio data를 변경합니다.
고정 byte corruption 예
80-88첫 예는 READ bio의 32번째 byte를 값 1로 바꾸며 별도 flag 조건은 없습니다.
corrupt_bio_byte 32 r 1 0
두 번째 예는 `REQ_META (=32)` flag가 있는 write bio의 224번째 byte를 값 0으로 바꿉니다.
corrupt_bio_byte 224 w 0 32
1-based byte 위치와 direction, replacement, required flag를 비교합니다.
주기적 failure injection
dm-flakey.rst:1-36Linear mapping 위에 up/down interval과 optional feature를 구성하는 table 형식을 설명합니다.