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

Tristan tristan.ye at oracle.com
Tue Oct 13 20:12:46 PDT 2009


Joel Becker wrote:
> 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?
>   
Good catch!

I'll later post another patch to warn user if quota wasn't enabled yet.

For inline-data corruptions, we do have such warnings:
if (!ocfs2_support_inline_data(osb))
FSWRK_FATAL("Should specify a inline-data supported "
"volume to do this corruption\n");

Thanks,
Tristan.


> Joel
>
>   




More information about the Ocfs2-tools-devel mailing list