[Ocfs2-tools-devel] [PATCH 2/2] Ocfs2-tools: Update fswreck part to meet fsck's enhancement of solving multiply-claimed clusters.

Joel Becker Joel.Becker at oracle.com
Tue Aug 11 15:01:44 PDT 2009


On Sun, Aug 02, 2009 at 03:32:44PM +0800, Tristan Ye wrote:
> +	if (type == DUP_CLUSTERS_SYSFILE_CLONE) {
> +
> +		di1->i_flags |= OCFS2_SYSTEM_FL;
> +		di2->i_flags |= OCFS2_SYSTEM_FL;
> +
> +		err = ocfs2_write_inode(fs, inode1_blkno, (char *)di1);
> +		if (err)
> +			FSWRK_COM_FATAL(progname, err);
> +		
> +		err = ocfs2_write_inode(fs, inode2_blkno, (char *)di2);
> +		if (err)
> +			FSWRK_COM_FATAL(progname, err);
> +
> +		fprintf(stdout, "DUP_CLUSTERS_SYSFILE_CLONE: "
> +			"Create two system inodes #%"PRIu64" and #%"PRIu64
> +			" by allocating same cluster to them.\n",
> +			inode1_blkno, inode2_blkno);

	This isn't correct, unfortunately.  This will create regular
files with the SYSTEM_FL flag set, which is invalid for ocfs2.  Instead,
you should create a new inode that has one extent pointing to an
existing extent of an existing system file.  Perhaps one of the journal
system files.

Joel

-- 

Life's Little Instruction Book #396

	"Never give anyone a fruitcake."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list