Re: [PATCH] Btrfs: Don't trust the superblock label and simply printk("%s") it

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

 



On Mon, Nov 05, 2012 at 02:10:49PM +0100, Stefan Behrens wrote:
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -764,10 +764,13 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
>  	devid = btrfs_stack_device_id(&disk_super->dev_item);
>  	transid = btrfs_super_generation(disk_super);
>  	total_devices = btrfs_super_num_devices(disk_super);
> -	if (disk_super->label[0])
> +	if (disk_super->label[0]) {
> +		if (disk_super->label[BTRFS_LABEL_SIZE - 1])
> +			disk_super->label[BTRFS_LABEL_SIZE - 1] = '\0';

The label set via 'btrfs fi label' will also set the last-1 byte to 0,
so this keeps it as expected, although it is silent.

thanks,
Reviewed-by: David Sterba <dsterba@xxxxxxx>

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