Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-08 Thread Anand Jain
On 12/07/2017 11:07 PM, Anand Jain wrote: On 12/07/2017 12:24 AM, David Sterba wrote: On Mon, Dec 04, 2017 at 06:20:09PM +0200, Nikolay Borisov wrote: I don't understand what problem *should* be solved here... Without any further checks and validation, we cannot simply iterate over all

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-06 Thread David Sterba
On Mon, Dec 04, 2017 at 06:20:09PM +0200, Nikolay Borisov wrote: > >> I don't understand what problem *should* be solved here... > > > > Without any further checks and validation, we cannot simply iterate over > > all superblocks and try to mount anything that looks ok. Even if the > > offsets

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-04 Thread Nikolay Borisov
On 4.12.2017 16:13, David Sterba wrote: > On Sun, Dec 03, 2017 at 11:43:13AM +0200, Nikolay Borisov wrote: >> On 2.12.2017 01:23, Anand Jain wrote: >>> On 12/01/2017 05:19 PM, Nikolay Borisov wrote: Currently this function executes the inner loop at most 1 due to the i = 0; i <

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-04 Thread David Sterba
On Sun, Dec 03, 2017 at 11:43:13AM +0200, Nikolay Borisov wrote: > On 2.12.2017 01:23, Anand Jain wrote: > > On 12/01/2017 05:19 PM, Nikolay Borisov wrote: > >> Currently this function executes the inner loop at most 1 due to the i > >> = 0; > >> i < 1 condition. Furthermore, the

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-03 Thread Anand Jain
On 12/03/2017 05:43 PM, Nikolay Borisov wrote: On 2.12.2017 01:23, Anand Jain wrote: On 12/01/2017 05:19 PM, Nikolay Borisov wrote: Currently this function executes the inner loop at most 1 due to the i = 0; i < 1 condition. Furthermore, the btrfs_super_generation(super) > transid code

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-03 Thread Nikolay Borisov
On 2.12.2017 01:23, Anand Jain wrote: > > > On 12/01/2017 05:19 PM, Nikolay Borisov wrote: >> Currently this function executes the inner loop at most 1 due to the i >> = 0; >> i < 1 condition. Furthermore, the btrfs_super_generation(super) > >> transid code >> in the if condition is never

Re: [PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-01 Thread Anand Jain
On 12/01/2017 05:19 PM, Nikolay Borisov wrote: Currently this function executes the inner loop at most 1 due to the i = 0; i < 1 condition. Furthermore, the btrfs_super_generation(super) > transid code in the if condition is never executed due to latest always set to NULL hence the first part

[PATCH 5/5] btrfs: Greatly simplify btrfs_read_dev_super

2017-12-01 Thread Nikolay Borisov
Currently this function executes the inner loop at most 1 due to the i = 0; i < 1 condition. Furthermore, the btrfs_super_generation(super) > transid code in the if condition is never executed due to latest always set to NULL hence the first part of the condition always triggering. The gist of