Re: [PATCH 1/3] block/integrity: make profile optional

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

 



On 1/11/24 9:09 AM, Keith Busch wrote:
> On Thu, Jan 11, 2024 at 09:00:19AM -0700, Jens Axboe wrote:
>>  #ifdef CONFIG_BLK_DEV_INTEGRITY
>> -	if (blk_integrity_rq(req) && req_op(req) == REQ_OP_READ)
>> +	if (blk_integrity_rq(req) && req_op(req) == REQ_OP_READ &&
>> +	    req->q->integrity.profile->complete_fn)
>>  		req->q->integrity.profile->complete_fn(req, total_bytes);
> 
> Since you're going to let profile be NULL, shouldn't this check be
> 'integrity.profile != NULL' instead of 'profile->complete_fn'?

Yep, it probably should... I'd need to check if we can have
blk_integrity_rq() be true if we don't have one, but in any case,
seems like the saner check.

-- 
Jens Axboe






[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