[lustre-devel] testing lustre
NeilBrown
neilb at suse.com
Fri Feb 9 15:52:41 PST 2018
On Fri, Feb 09 2018, Благодаренко Артём wrote:
> 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
Ahhh.. found it. Thanks for lot for the details!!
And and I can see in an strace that this is being called - mount.lustre
forks and runs "tune2fs -f -L ....".
But still the volume name doesn't change.
Maybe I have a buggy tune2fs.
I note that tune2fs says "recovering journal" or something like that.
I suspect we don't want that to happen when the filesystem is mounted.
Maybe that is related to the failure to change the label.
I will dig in more deeply.
thanks a lot,
NeilBrown
>
>>
>> Thanks,
>> NeilBrown
>
> Best regards,
> Artem Blagodarenko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20180210/2b0dc457/attachment.sig>
More information about the lustre-devel
mailing list