Re: [PATCH] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

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

 



On Wed, Apr 17, 2013 at 10:19:09AM +0800, Anand Jain wrote:
> 
> 
> On 04/16/2013 07:57 PM, David Sterba wrote:
> >On Fri, Apr 12, 2013 at 03:55:06PM +0800, Anand Jain wrote:
> >>If one of the copy of the superblock is zero it does not
> >>confirm to us that btrfs isn't there on that disk. When
> >>we are having more than one copy of superblock we should
> >>rather let the for loop to continue to check other copies.
> >>
> >>the following test case and results would justify the
> >>fix
> >>
> >>mkfs.btrfs /dev/sdb /dev/sdc -f
> >>mount /dev/sdb /btrfs
> >>dd if=/dev/zero bs=1 count=8 of=/dev/sdc seek=$((64*1024+64))
> >>~/before/btrfs-select-super -s 1 /dev/sdc
> >>using SB copy 1, bytenr 67108864
> >>
> >>here btrfs-select-super just wrote superblock to a mounted btrfs
> >
> >Why does not check_mounted() catch this in the first place? Ie. based on
> >the status in /proc/mounts not on random bytes in the superblock.
> 
>  the reason is, as of now /proc/mounts just knows about the devid 1.

My oversight, it's mkfs on sdb and select-super on sdc, but then sdc is
already open and the open(O_EXCL) should prevent that, right? The same
way mkfs checks whether all the devices are available.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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