Re: [PATCH v5.1 10/12] btrfs: extent_io: Kill the BUG_ON() in extent_write_cache_pages()

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

 




On 2019/3/12 上午8:33, David Sterba wrote:
> On Mon, Feb 18, 2019 at 01:27:51PM +0800, Qu Wenruo wrote:
>> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
>> Reviewed-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
>> ---
>>  fs/btrfs/extent_io.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
>> index 1572e892ec7b..480e138051f0 100644
>> --- a/fs/btrfs/extent_io.c
>> +++ b/fs/btrfs/extent_io.c
>> @@ -3998,7 +3998,10 @@ static int extent_write_cache_pages(struct address_space *mapping,
>>  			 */
>>  			if (!trylock_page(page)) {
>>  				ret = flush_write_bio(epd);
>> -				BUG_ON(ret < 0);
>> +				if (ret < 0) {
> 
> This needs some more explanation why it's correct, there's conditional
> locking and writeback status manipulation. Thanks.

Because flush_write_bio() handles the cleanup in its endio function.

Thus we don't need extra cleanup in this case.

Thanks,
Qu

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