Re: [PATCH v2 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-29 Thread Anand Jain
- btrfs_release_disk_super(page); -> error_bdev_put: You need a check whether page_primary is set here and release it, otherwise you are leaking it. This needs to handle both the primary sb read failure (where page_primary might not be set) as well as any FSID mismatch from loop.

Re: [PATCH v2 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-28 Thread Nikolay Borisov
On 28.03.2018 02:39, Anand Jain wrote: > During the btrfs dev scan make sure that other copies of superblock > contain the same fsid as the primary SB. So that we bring to the > user notice if the superblock has been overwritten. > > mkfs.btrfs -fq /dev/sdc > mkfs.btrfs -fq /dev/sdb > dd

[PATCH v2 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-27 Thread Anand Jain
During the btrfs dev scan make sure that other copies of superblock contain the same fsid as the primary SB. So that we bring to the user notice if the superblock has been overwritten. mkfs.btrfs -fq /dev/sdc mkfs.btrfs -fq /dev/sdb dd if=/dev/sdb of=/dev/sdc count=4K skip=64K seek=64K obs=1