UUID & volume labels support for reiserfs
PATCH 1/1 UUID & volume labels support for reiserfs
Hello!
Attached is the patch that reserves space for volume label and UUID in reiserfs v3.6 superblock. It also generates random UUID for volumes converted from 3.5 to 3.6 format by the kernel. Original patch author is Andreas Dilger <[email protected]>.
Please apply.
Bye,
Oleg
fs/reiserfs/objectid.c renamed from fs/reiserfs/objectid.c.orig +5 -0
@@ -5,6 +5,7 @@#include <linux/config.h> #include <linux/string.h> #include <linux/locks.h> +#include <linux/random.h> #include <linux/sched.h> #include <linux/reiserfs_fs.h>
@@ -195,6 +196,10 @@/* set the max size so we don't overflow later */ disk_sb->s_oid_maxsize =cpu_to_le16 (new_size) ; + +/* Zero out label and generate random UUID */ +memset (disk_sb->s_label,0 ,sizeof (disk_sb->s_label)) ; +generate_random_uuid (disk_sb->s_uuid);/* finally, zero out the unused chunk of the new super */ memset (disk_sb->s_unused,0 ,sizeof (disk_sb->s_unused)) ;
include/linux/reiserfs_fs_sb.h renamed from include/linux/reiserfs_fs_sb.h.orig +7 -1
@@ -61,7 +61,13 @@superblock. -Hans */ __u16 s_reserved;__u32 s_inode_generation; -char s_unused[124 ] ;/* zero filled by mkreiserfs */ +__u32 s_flags;/* Right now used only by inode-attributes, if enabled */ +unsigned char s_uuid[16 ];/* filesystem unique identifier */ +unsigned char s_label[16 ];/* filesystem volume label */ +char s_unused[88 ] ;/* zero filled by mkreiserfs and +* reiserfs_convert_objectid_map_v1() +* so any additions must be updated +* there as well. */ } __attribute__ ((__packed__));#define SB_SIZE (sizeof(struct reiserfs_super_block))
Quoted 6 lines · On Wednesday, January 09, 2002 03:55:04 PM +0300 Oleg Drokin…
Hello!
Attached is the patch that reserves space for volume label and UUID
in reiserfs v3.6 superblock. It also generates random UUID for
volumes converted from 3.5 to 3.6 format by the kernel. Original
patch author is Andreas Dilger <[email protected]>. Please apply.
This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
-chris
Hello!
Quoted 6 lines · Chris Mason
Quoted 4 lines
Attached is the patch that reserves space for volume label and UUID
in reiserfs v3.6 superblock. It also generates random UUID for
volumes converted from 3.5 to 3.6 format by the kernel. Original
patch author is Andreas Dilger <[email protected]>. Please apply.This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
Hey, reserving some space in superblock won't hurt.
And when actual reiserfsprogs and util-linux support will appear, people will just start to use these features. On the other side, if tools supporting this stuff will get out earlier than kernel support, bad things may happen. And Hans is thinking that time for this patch is right, too.
Bye,
Oleg
Quoted 4 lines · On Wednesday, January 09, 2002 06:58:26 PM +0300 Oleg Drokin…
Hello!
On Wed, Jan 09, 2002 at 10:47:59AM -0500, Chris Mason wrote:
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Attached is the patch that reserves space for volume label and UUID
in reiserfs v3.6 superblock. It also generates random UUID for
volumes converted from 3.5 to 3.6 format by the kernel. Original
patch author is Andreas Dilger <[email protected]>. Please
apply.This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
Hey, reserving some space in superblock won't hurt.
Reserving it is fine ;-) Using it isn't a good idea until the progs understand it. Our policy should be to never require a progs update in a stable kernel series (just like most stable parts of the kernel).
But, the progs are improving so quickly that we should bend this rule a little bit. Another example is the unlink truncate patch never should have been sent to Marcelo without a non-beta reiserfsprogs that understood it. Neither should this patch (even though it is a much smaller problem).
-chris
Hello!
Quoted 4 lines · Chris Mason
Quoted 3 lines
Quoted 2 lines
This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
Hey, reserving some space in superblock won't hurt.
Reserving it is fine ;-) Using it isn't a good idea until the progs
So we did it (reserved) ;)
We do not use it. (generating of UUID does not count)
Quoted 2 lines
understand it. Our policy should be to never require a progs update in a stable kernel series (just like most stable parts of the kernel).
We do not require progs upadte. But if someone will update their progs voluntarily, we cannot forbit them to! ;))
Quoted 1 line
Neither should this patch (even though it is a much smaller problem).
You just said that reserving is ok.
Bye,
Oleg
Quoted 10 lines · On Wednesday, January 09, 2002 07:25:26 PM +0300 Oleg Drokin…
Hello!
Quoted 4 lines · Chris Mason
Quoted 3 lines
Quoted 2 lines
This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
Hey, reserving some space in superblock won't hurt.
Reserving it is fine ;-) Using it isn't a good idea until the progs
So we did it (reserved) ;)
We do not use it. (generating of UUID does not count)
Yes, generating a uuid and storing in the super block counts as using the field ;-)
Quoted 6 lines
Quoted 3 lines
understand it. Our policy should be to never require a progs update in a stable kernel series (just like most stable parts of the kernel).
We do not require progs upadte. But if someone will update their progs voluntarily, we cannot forbit them to! ;))
The point is that we should never add something to the kernel until our utils package understands it. Yes, this is a simple case, but if we want to call reiserfs stable, there are some basic rules we need to start following.
-chris
Hello!
Quoted 8 lines · Chris Mason
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
This should not be applied until an updated (non beta) reiserfsprogs package that supports these features has been released.
Hey, reserving some space in superblock won't hurt.
Reserving it is fine ;-) Using it isn't a good idea until the progs
So we did it (reserved) ;)
We do not use it. (generating of UUID does not count)Yes, generating a uuid and storing in the super block counts as using the field ;-)
Does filling something with zeroes counts as "using the field"? ;)
Quoted 2 lines
The point is that we should never add something to the kernel until our utils package understands it. Yes, this is a simple case, but if we want
In fact, current reiserfsprogs understands these fields (look into the the struct super_block definition in reiserfsprogs). It just cannot change content of the fields.
Quoted 2 lines
to call reiserfs stable, there are some basic rules we need to start following.
Sure.
Bye,
Oleg
Quoted 1 line · On Wednesday, January 09, 2002 07:44:30 PM +0300 Oleg Drokin…
Does filling something with zeroes counts as "using the field"? ;)
We must be reading different versions of generate_random_uuid ;-)
Quoted 6 lines
Quoted 3 lines
The point is that we should never add something to the kernel until our utils package understands it. Yes, this is a simple case, but if we want
In fact, current reiserfsprogs understands these fields (look into the the struct
super_blockdefinition in reiserfsprogs). It just cannot change content of the fields.
/* Structure of super block on disk */
struct reiserfs_super_block
{
/* 0 */ struct reiserfs_super_block_v1 s_v1; /* 76 */ char sb_mnt_version[16]; /* 92 */ char sb_mkfs_version[16]; /*108 */ char sb_fsck_version[16]; /*124 */ char sb_unused[204-16-16-16-SB_SIZE_V1] ;
/* zero filled by mkreiserfs */ };
Show me the part where it knows what a uuid is. It should at least be able to show the uuid set by the kernel.
Please don't take this the wrong way, this is a good (and simple) patch that adds a cool feature. We just need to do a better job of having the utils support the features before sending the patch it. It does a better job of proving we've tested the feature and that kernel patch fully meets our needs.
-chris
Hello!
Quoted 11 lines · Chris Mason
Quoted 3 lines
In fact, current reiserfsprogs understands these fields (look into the the struct
super_blockdefinition in reiserfsprogs). It just cannot change content of the fields./* Structure of super block on disk */
structreiserfs_super_block
{/* 0 */ struct reiserfs_super_block_v1 s_v1; /* 76 */ char sb_mnt_version[16]; /* 92 */ char sb_mkfs_version[16]; /*108 */ char sb_fsck_version[16]; /*124 */ char sb_unused[204-16-16-16-SB_SIZE_V1] ;
Quoted 4 lines
/* zero filled by mkreiserfs */ };
Show me the part where it knows what a uuid is. It should at least be able to show the uuid set by the kernel.
It does not know about uuid per se, but it know in that area some text data is stored.
(BTW, we are started to fix reiserfsprogs, so that struct superblock will be the same in kernel and in reiserfsprogs. It is already almost close in cvs ;) )
I see MArcello have not applied this patch to 2.4.18-pre3, so we have some more time to prepare reiserfsprogs ;)
Bye,
Oleg