[Ocfs2-tools-devel] The patches for backup superblock(processed by quilt).

Sunil Mushran Sunil.Mushran at oracle.com
Wed Dec 6 18:49:48 PST 2006


I got time to review just two of the patches. Will do the remaining
tomorrow.

backup_libocfs2.patch

1. In ocfs2_set_backup_sb(), the writes need to be ordered.
==> First initialize all the cluster(s) with zeroes.
==> Then set/write the bits in the cluster bitmap.
==> Then write the backup sbs.
==> Do not update the main superblock. That should be handled in 
mkfs/tunefs.


Also, we have tried to limit the use of endian helper macros
to functions that read/write the disk. For sb, it would be
ocfs2_read_super() and ocfs2_write_super(). It will be better
if we add a ocfs2_write_backup_super() that memcpys fs->fs_super,
modifies the blocknum, ors the compat flag and writes to disk. That
function should be in openfs.c.

BTW, fs->fs_super is the superblock. You don't have to re-read it.

2. In verify_block_allocation():
+       *len = i;
???

3. Shouldn't ocfs2_get_backup_sb_offset() return i?
As in, number of possible offsets for volume size. Currently you are
relying on ocfs2_set_backup_sb() to ensure the blokno is > 0.
Well, atleast in mkfs you are not checking for that. It may be better
if you return the number of offsets making the code flow like:

+       numblks = ocfs2_get_backup_sb_offset(fs, blocks, 
ARRAY_SIZE(blocks));
+
+       ret = ocfs2_set_backup_sb(fs, blocks, numblks);
+       if (ret) {
+               com_err(s->progname, ret, "while backuping superblock.");
+               goto error;
+       }

backup_mkfs.patch
See above


tao.ma wrote:
> Hi all,
> The new patches for the backup superblock. It is processed by quilt.
> Thank mark for your advice.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
>   



More information about the Ocfs2-tools-devel mailing list