I have several partitions for my Gentoo installation, with separate /boot (ext2), / {ROOT} (ext3) and /usr/portage (ext3). Recently I needed to resize the last partition and I thought about testing reiserfs 3.6. All of my partitions have labels (hint: "mke2fs -L") so at boot I can easily see which partitions are fsck-ed. So while reformatting my last partition /dev/hda8 as reiserfs 3.6, I've labeled it "PORTAGE" (hint: "mkreiserfs -l"). Alas, upon boot fsck.reiserfs never displayed a volume label set this way. But I've checked the source and actually all the needed data were already in place. I mean: the reiserfs_super_block structure contains the needed s_label field. So I've changed a bit reiserfscore/prints.c file and voila! Now the volume label shows exactly as I would like it to see. And if there's no volume label, nothing is printed and the message is exactly the same as in the original, unmodified reiserfsprogs. I know, I know, it's cosmetic :-) But for me it's more consistent this way. And it was VERY easy to add :-) Reproducible: Always Steps to Reproduce: 1. Create a reiserfs 3.6 filesystem, with or without -l (label) option. 2. Mention this filesystem in the /etc/fstab, and set the last field <pass> to some positive integer. 3. # emerge -av =sys-fs/reiserfsprogs-3.6.19 4. # fsck -C -T -R -A -a Actual Results: Both fsck.ext2 and fsck.ext3 display volume label, if they can find it. While fsck.reiserfs never displays any volume label (see third line/disk): # fsck -C -T -R -A -a BOOT: clean, 62/297256 files, 60311/594405 blocks /dev/hda5 is mounted. e2fsck: Cannot continue, aborting. Reiserfs super block in block 16 on 0x308 of format 3.6 with standard journal Blocks (total/free): 1275136/773937 by 4096 bytes Filesystem is clean Replaying journal.. Reiserfs journal '/dev/hda8' in blocks [18..8211]: 0 transactions replayed Checking internal tree..finished SPARE: clean, 16/1540096 files, 1813541/3074431 blocks Expected Results: Display volume label if it is set, like "PORTAGE" for my /dev/hda8 (3rd line): # fsck -C -T -R -A -a BOOT: clean, 62/297256 files, 60311/594405 blocks /dev/hda5 is mounted. e2fsck: Cannot continue, aborting. PORTAGE: Reiserfs super block in block 16 on 0x308 of format 3.6 with standard journal ... SPARE: clean, 16/1540096 files, 1813541/3074431 blocks I will add a patch for the sys-fs/reiserfsprogs-3.6.19. I think it really should be safe wrt. to reiserfs v.3.5 and v.3.6, and is also applicable to the reiserfsprogs-3.6.18 and reiserfsprogs-3.6.17. The maintainers should decide whether this behaviour is desired or not. Even if it's non-standard (I mean: original fsck.reiserfs doesn't have it), for me it's important enough to bother myself. I can safely handle it for my own needs, but I thought: "hey, maybe someone will find it useful too?" If someone is extra-paranoid, then this patch can be enhanced to be extra-safe and strictly compatible with reiserfs v.1.0 and v.1.1. And I have NEVER seen such versions of reiserfs, btw.
Created attachment 70571 [details, diff] reiserfscore-prints.c-display_volume_label.diff The patch should be applied to the reiserfsprogs-3.6.19/reiserfscore/prints.c in the unpacked source directory.
Comment on attachment 70571 [details, diff] reiserfscore-prints.c-display_volume_label.diff >620a621,624 >> /* Print volume label if it is non-empty. */ >> if (sb->s_label[0]) { >> reiserfs_warning (fp, "%s: ", sb->s_label); >> }
Comment on attachment 70571 [details, diff] reiserfscore-prints.c-display_volume_label.diff >620a621,624 >> // Print volume label if it is non-empty. >> if (sb->s_label[0]) { >> reiserfs_warning (fp, "%s: ", sb->s_label); >> } 620a621,624 > /* Print volume label if it is non-empty. */ > if (sb->s_label[0]) { > reiserfs_warning (fp, "%s: ", sb->s_label); > }
The above should change the print_super_block function, as following: /* return 1 if this is not super block */ int print_super_block (FILE * fp, reiserfs_filsys_t * fs, char * file_name, struct buffer_head * bh, int short_print) { struct reiserfs_super_block * sb = (struct reiserfs_super_block *)(bh->b_data); dev_t rdev; int format = 0; __u16 state; if (!does_look_like_super_block (sb)) return 1; rdev = misc_device_rdev(file_name); /* Print volume label if it is non-empty. */ if (sb->s_label[0]) { reiserfs_warning (fp, "%s: ", sb->s_label); } reiserfs_warning (fp, "Reiserfs super block in block %lu on 0x%x of ", bh->b_blocknr, rdev); switch (get_reiserfs_format (sb)) {
Brr. Ugly. I can't figure out how to change the patch as I incorrectly put the C++ style comment instead of C-style. Patch resubmitted.
Created attachment 70572 [details, diff] reiserfscore-prints.c-display_volume_label.diff with C-style comment Resubmitted the patch. Sorry for the mess... I'm still learning.
Created attachment 70573 [details, diff] reiserfscore-prints.c-display_volume_label.diff with correct C-style comment Aaaaahhhh! Wrong comment again! I suppose this will be thrown out of the window... Resubmitted the patch.
Why don't you take this upstream (reiserfs-list@namesys.com)?
yeah, this isnt something to add to Gentoo
I think you're right. I'll try to post that upstream.
Well, I did what I could. See here: http://article.gmane.org/gmane.comp.file-systems.reiserfs.general/16553 http://news.gmane.org/gmane.comp.file-systems.reiserfs.general A small discussion started which also touched ReiserFS v.4 and its handling of volume labels. Good to know that it may incorporate my desired behaviour one day too. Even though I don't use it right now. And at the end Vitaly Fertman (the developer) said he will apply my patch. Finally in the PM he said that's already done. Very, very nice :-) Now all that's left is to wait for updated version of reiserfsprogs. Thanks for the motivation, jakub && vapier !!