[Ocfs2-tools-devel] [PATCH 1/1] Ocfs2-tools: Add quota corruption codes to fswreck.

Joel Becker Joel.Becker at oracle.com
Tue Oct 13 16:36:18 PDT 2009


On Fri, Oct 09, 2009 at 11:04:14AM +0800, Tristan Ye wrote:
> +void mess_up_quota(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum)
> +{
> +	errcode_t ret;
> +	int qtype;
> +	char *buf;
> +	int tree_depth = ocfs2_qtree_depth(fs->fs_blocksize);
> +
> +	struct ocfs2_disk_dqheader *header;
> +	struct ocfs2_global_disk_dqblk *ddquot;
> +	struct qt_disk_dqdbheader *dh;
> +
> +	ret = ocfs2_init_fs_quota_info(fs, USRQUOTA);
> +	if (ret)
> +		FSWRK_COM_FATAL(progname, ret);
> +
> +	ret = ocfs2_init_fs_quota_info(fs, GRPQUOTA);
> +	if (ret)
> +		FSWRK_COM_FATAL(progname, ret);

	I realize that you've already committed.  What if quota support
isn't enabled on disk?  Are you expecting the user will just deal with
the fatal error here?  That certainly works, but "No such file or
directory" isn't quite as nice as "Hey, you can't do quota corruptions
when quota isn't enabled!"
	We have the same problem with inline data.  We can do inline
data corruptions even on a filesystem without the feature.  We just
blatantly set i_dyn_features.  Should we be warning or erroring?

Joel

-- 

"And yet I fight,
 And yet I fight this battle all alone.
 No one to cry to;
 No place to call home."

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