Re: [PATCH] btrfs-progs: traverse to backup super-block only when indicated

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

 



On Fri, Mar 01, 2013 at 06:13:20PM +0800, Anand Jain wrote:
> This patch adds 4th parameter to btrfs_scan_one_device()
> which when set to non-zero value will traverse to check
> backup super-block.

Cool, thanks for working on this.

How'd you decide which callers wanted to scan the backups and which
didn't?  Where are the options to force checking the backups?  This
should be discussed in the commit message.

>  	for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
> +		if (i > 0 && !rd_sb_mirror)
> +			break;

FWIW, I probably would have done something like

	max = rd_sb_mirror ? BTRFS_SUPER_MIRROR_MAX : 1;
  	for (i = 0; i < max; i++) {

> -		if((ret = btrfs_scan_for_fsid(fs_devices_mnt, total_devs, 1)))
> +		if((ret = btrfs_scan_for_fsid(fs_devices_mnt, total_devs, 1, 0)))

I agree with Eric.  The ", 1, 0" isn't great.  I guess I'd go for flags
(SCAN_REGISTER|SCAN_BACKUPS), but don't feel strongly about it.
Whatever feels least gross to you ;).

- z 
--
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