lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cdca4c95-27a0-5964-e242-173281c4e8f9@huaweicloud.com>
Date: Tue, 29 Apr 2025 09:48:12 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Christoph Hellwig <hch@....de>, Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, kbusch@...nel.org, linux-block@...r.kernel.org,
 linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
 johnny.chenyi@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2 1/3] brd: protect page with rcu

Hi,

在 2025/04/28 20:52, Christoph Hellwig 写道:
> On Sun, Apr 27, 2025 at 04:39:23PM +0800, Yu Kuai wrote:
>>   	page = brd_lookup_page(brd, sector);
>>   
>>   	kaddr = bvec_kmap_local(&bv);
>>   	if (op_is_write(opf)) {
>> -		BUG_ON(!page);
>> -		memcpy_to_page(page, offset, kaddr, bv.bv_len);
>> +		if (page)
>> +			memcpy_to_page(page, offset, kaddr, bv.bv_len);
> 
> This could use a comment on why page can be NULL here.
OK

> 
>>   	} else if (page) {
>>   		memcpy_from_page(kaddr, page, offset, bv.bv_len);
>>   	} else {
>>   		memset(kaddr, 0, bv.bv_len);
> 
> And why the above change my if/else cascade doesn't really make much sense
> any more and this should become:
> 
> 	} else {
> 		if (page)
> 	 		memcpy_from_page(kaddr, page, offset, bv.bv_len);
> 		else
> 	 		memset(kaddr, 0, bv.bv_len);
>   	}
OK, I will send a new version soon.

Thanks for the review!
Kuai

> 
> Otherwise looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@....de>
> .
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ