Re: [PATCH v4 04/12] btrfs: extent_io: Move the BUG_ON() in flush_write_bio() one level up

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

 




On 2019/1/30 下午11:19, David Sterba wrote:
> On Fri, Jan 25, 2019 at 01:09:17PM +0800, Qu Wenruo wrote:
>> +static int __must_check flush_write_bio(struct extent_page_data *epd)
>>  {
>> -	if (epd->bio) {
>> -		int ret;
>> +	int ret = 0;
>>  
>> +	if (epd->bio) {
>>  		ret = submit_one_bio(epd->bio, 0, 0);
>> -		BUG_ON(ret < 0); /* -ENOMEM */
>>  		epd->bio = NULL;
> 
> I'm not sure if resetting epd->bio to NULL is all that needs to be done
> here. With the BUG_ON the error case never happens so if all goes fine
> it's also ok to set it to NULL and continue. But the callers might need
> to send the flush again.

If flush_write_bio() get called again on the failed one, it will just
get skipped as  epd->bio is NULL, submit_one_bio() will not be triggered.

Thanks,
Qu

> 
> It's not easy to trace the bio here, it's set indirectly in
> submit_extent_page, submit_one_bio is another indirection, switching by
> type and sometimes bio_endio is called in case of an error.
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux