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: <48fbead1-bd3b-e182-6916-1c3652d4de08@suse.com>
Date:   Fri, 1 May 2020 10:06:03 +0800
From:   Qu Wenruo <wqu@...e.com>
To:     Stephen Rothwell <sfr@...b.auug.org.au>,
        David Sterba <dsterba@...e.cz>
CC:     Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Josef Bacik <josef@...icpanda.com>
Subject: Re: linux-next: manual merge of the btrfs tree with the btrfs-fixes
 tree



On 2020/5/1 上午9:05, Stephen Rothwell wrote:
> Hi all,
> 
> On Fri, 1 May 2020 10:24:53 +1000 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>>
>> Today's linux-next merge of the btrfs tree got a conflict in:
>>
>>   fs/btrfs/transaction.c
>>
>> between commit:
>>
>>   fcc99734d1d4 ("btrfs: transaction: Avoid deadlock due to bad initialization timing of fs_info::journal_info")
>>
>> from the btrfs-fixes tree and commit:
>>
>>   f12ca53a6fd6 ("btrfs: force chunk allocation if our global rsv is larger than metadata")
>>
>> from the btrfs tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary. This
>> is now fixed as far as linux-next is concerned, but any non trivial
>> conflicts should be mentioned to your upstream maintainer when your tree
>> is submitted for merging.  You may also want to consider cooperating
>> with the maintainer of the conflicting tree to minimise any particularly
>> complex conflicts.
>>
>> -- 
>> Cheers,
>> Stephen Rothwell
>>
>> diff --cc fs/btrfs/transaction.c
>> index 2d5498136e5e,e4dbd8e3c641..000000000000
>> --- a/fs/btrfs/transaction.c
>> +++ b/fs/btrfs/transaction.c
>> @@@ -666,15 -674,17 +672,26 @@@ got_it
>>   		current->journal_info = h;
>>   
>>   	/*
>>  +	 * btrfs_record_root_in_trans() needs to alloc new extents, and may
>>  +	 * call btrfs_join_transaction() while we're also starting a
>>  +	 * transaction.
>>  +	 *
>>  +	 * Thus it need to be called after current->journal_info initialized,
>>  +	 * or we can deadlock.
>>  +	 */
>>  +	btrfs_record_root_in_trans(h, root);
>>  +
>> + 	 * If the space_info is marked ALLOC_FORCE then we'll get upgraded to
>> + 	 * ALLOC_FORCE the first run through, and then we won't allocate for
>> + 	 * anybody else who races in later.  We don't care about the return
>> + 	 * value here.
>> + 	 */
>> + 	if (do_chunk_alloc && num_bytes) {
>> + 		u64 flags = h->block_rsv->space_info->flags;
>> + 		btrfs_chunk_alloc(h, btrfs_get_alloc_profile(fs_info, flags),
>> + 				  CHUNK_ALLOC_NO_FORCE);
>> + 	}
>> + 
>>   	return h;

The proper fix has landed in David's misc-next branch, which puts
btrfs_record_root_in_trans(); after the if () {} code block.

By that, btrfs_record_root_in_trans() has lesser chance to hit ENOSPC.

Thanks,
Qu

>>   
>>   join_fail:
> 
> 
> I fixed the missing comment start in my resolution ...
> 



Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ