RE: [PATCH] btrfs-progs: mkfs: Replace number with enum

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

 




> -----Original Message-----
> From: David Sterba [mailto:dsterba@xxxxxxx]
> Sent: Tuesday, August 22, 2017 10:04 PM
> To: Gu, Jinxiang/顾 金香 <gujx@xxxxxxxxxxxxxx>; linux-btrfs@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] btrfs-progs: mkfs: Replace number with enum
> 
> On Mon, Aug 21, 2017 at 07:39:49PM +0200, David Sterba wrote:
> > > +/* roots: root tree, extent tree, chunk tree, dev tree, fs tree,
> > > +csum tree */ enum btrfs_mkfs_block {
> > > +	SUPER_BLOCK = 0,
> > > +	ROOT_TREE,
> > > +	EXTENT_TREE,
> > > +	CHUNK_TREE,
> > > +	DEV_TREE,
> > > +	FS_TREE,
> > > +	CSUM_TREE,
> > > +	BLOCK_COUNT
> 
> BLOCK_COUNT is 7

> 
> > > +};
> > > +
> > >  struct btrfs_mkfs_config {
> > >  	/* Label of the new filesystem */
> > >  	const char *label;
> > > @@ -43,7 +55,7 @@ struct btrfs_mkfs_config {
> > >  	/* Output fields, set during creation */
> > >
> > >  	/* Logical addresses of superblock [0] and other tree roots */
> > > -	u64 blocks[8];
> > > +	u64 blocks[BLOCK_COUNT];
> 
> This replaces 8 with 7 then, so the fs_uuid gets overwritten, can be also caught by simply running 'make test-mkfs'.

I made this change because block[7] is never used. I have run 'make test-mkfs', and get no error.
Why need to make a u64 left before fs_uuid?

> 
> > >  	char fs_uuid[BTRFS_UUID_UNPARSED_SIZE];
> > >  	char chunk_uuid[BTRFS_UUID_UNPARSED_SIZE];
> > >
> > > --
> > > 2.9.4
> > >
> > >
> > >
> > > --
> > > 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
> > --
> > 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
> 



?韬{.n?????%??檩??w?{.n???{饼?~镶?^n?■???h?璀?{?夸z罐?+€?zf"?????i?????_璁?:+v??撸?





[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