[lustre-devel] testing lustre

Благодаренко Артём artem.blagodarenko at gmail.com
Fri Feb 9 00:51:52 PST 2018


Hello NeilBrown,


> On 9 Feb 2018, at 04:03, NeilBrown <neilb at suse.com> wrote:
> 
> On Thu, Feb 08 2018, Благодаренко Артём wrote:
> 
>> Hello NeilBrown,
>> 
>> Symbol “:” is added to name for targets which have never been registered. tunefs and mount use this symbol to
>> set LDD_F_VIRGIN flag in ldd.
>> 
>> Here is code from lustre/utils/mkfs_lustre.c (executed in tunefs)
>> 
>> /* svname of the form lustre:OST1234 means never registered */
>>        ret = strlen(ldd->ldd_svname);
>>        if (ldd->ldd_svname[ret - 8] == ':') {
>>                ldd->ldd_svname[ret - 8] = '-';
>>                ldd->ldd_flags |= LDD_F_VIRGIN;
>> 
>> And 
>> 
>> lustre/utils/mount_lustre.c
>> 
>> /* svname of the form lustre:OST1234 means never registered */
>>        rc = strlen(ldd->ldd_svname);
>>        if (strcmp(ldd->ldd_svname, "MGS") != 0) {
>>                if (rc < 8) {
>>                        fprintf(stderr, "%s: invalid name '%s'\n",
>>                                progname, ldd->ldd_svname);
>>                        return EINVAL;
>>                } else if (ldd->ldd_svname[rc - 8] == ':') {
>>                        ldd->ldd_svname[rc - 8] = '-';
>>                        ldd->ldd_flags |= LDD_F_VIRGIN;
>> 
>> So I believe the test expects freshly created target.
> 
> Thanks for the reply.  This is helpful, but there is still something
> missing in my understanding.
> 
> At what stage does a filesystem transition from "VIRGIN" to "not
> VIRGIN”??

To exclude misunderstanding let’s clarify - this is stage of target, not filesystem. 
At moment then target is formatted it is VIRGIN. Then it first time mounted it becomes not VIRGIN.

> When does the ":" get replaced by a "-" in the on-disk volume name?
> What, exactly, does it mean to be "registered” ?

At moment target is mounting it sends request to mgs and becomes registered. 
This is requirement for successful registration. After such successful first mount “:” replaced to “-“ in the on-disk volume name. 

> I cannot find anywhere in the code that would write out a new label, or
> that would call e2label or tune2fs to do it.

mount utility (mount_lustre.c)
Main->
	parse_ldd() -> ldd() read ldd. In  and change : to - in memory
	mount() - mount target, register it on mgs
	label_lustre () write new label with “-“ on disk

> 
> Thanks,
> NeilBrown

Best regards,
Artem Blagodarenko



More information about the lustre-devel mailing list