Re: [PATCH 1/5] blktrace: add zoned block commands to blk_fill_rwbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09.07.25 17:31, Bart Van Assche wrote:
> On 7/9/25 4:47 AM, Johannes Thumshirn wrote:
>> Add zoned block commands to blk_fill_rwbs:
>>
>> - ZONE APPEND will be decoded as 'ZA'
>> - ZONE RESET and ZONE RESET ALL will be decoded as 'ZR'
>> - ZONE FINISH will be decoded as 'ZF'
>> - ZONE OPEN will be decoded as 'ZO'
>> - ZONE CLOSE will be decoded as 'ZC'
>>
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
>> ---
>>    kernel/trace/blktrace.c | 21 +++++++++++++++++++++
>>    1 file changed, 21 insertions(+)
>>
>> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
>> index 3f6a7bdc6edf..f1dc00c22e37 100644
>> --- a/kernel/trace/blktrace.c
>> +++ b/kernel/trace/blktrace.c
>> @@ -1875,6 +1875,27 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
>>    	case REQ_OP_READ:
>>    		rwbs[i++] = 'R';
>>    		break;
>> +	case REQ_OP_ZONE_APPEND:
>> +		rwbs[i++] = 'Z';
>> +		rwbs[i++] = 'A';
>> +		break;
>> +	case REQ_OP_ZONE_RESET:
>> +	case REQ_OP_ZONE_RESET_ALL:
>> +		rwbs[i++] = 'Z';
>> +		rwbs[i++] = 'R';
>> +		break;
>> +	case REQ_OP_ZONE_FINISH:
>> +		rwbs[i++] = 'Z';
>> +		rwbs[i++] = 'F';
>> +		break;
>> +	case REQ_OP_ZONE_OPEN:
>> +		rwbs[i++] = 'Z';
>> +		rwbs[i++] = 'O';
>> +		break;
>> +	case REQ_OP_ZONE_CLOSE:
>> +		rwbs[i++] = 'Z';
>> +		rwbs[i++] = 'C';
>> +		break;
>>    	default:
>>    		rwbs[i++] = 'N';
>>    	}
> 
> Has it been considered to add a warning statement in blk_fill_rwbs()
> that verifies that blk_fill_rwbs() does not write outside the bounds of
> the rwbs array? See also the RWBS_LEN definition.

$ git grep -E "#define\sRWBS_LEN"
include/trace/events/block.h:#define RWBS_LEN   9

So even if we would have

opf = (REQ_PREFLUSH | REQ_OP_ZONE_APPEND | REQ_FUA | REQ_RAHEAD |
	 REQ_SYNC | REQ_META | REQ_ATOMIC);

it'll be 8 including the trailing \0 it'll be 9.


If you look closely, REQ_OP_SECURE_ERASE already is 'DE' so no changes.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux