[LU-3856] No volume label updates after registered target Created: 29/Aug/13  Updated: 24/Sep/13  Resolved: 24/Sep/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.0
Fix Version/s: Lustre 2.5.0

Type: Bug Priority: Critical
Reporter: Alexander Boyko Assignee: Alex Zhuravlev
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 10007

 Description   

reproducer

mkfs.lustre --mgs --mdt  --fsname=lustre --device-size=100000 --reformat /dev/sdb
mount -t lustre -o nosvc,abort_recov  -n /dev/sdb /mnt/mgt
e2label /dev/sdb
mount -t lustre -o nomgs,abort_recov  -n /dev/sdb /mnt/mdt
e2label /dev/sdb

For 2.3 Lustre the result of e2label is

lustre:MDT0000
lustre-MDT0000

For 2.4 Lustre

lustre:MDT0000
lustre:MDT0000

Later this cause error ... index is already in use.

I think that this part of mount_lustre.c is invalid.

    } else if (!mop.mo_nomtab) {
                rc = update_mtab_entry(mop.mo_usource, mop.mo_target, "lustre",
                                       mop.mo_orig_options, 0,0,0);

                /* change label from <fsname>:<index> to <fsname>-<index>
                 * to indicate the device has been registered. */
                if (mop.mo_ldd.ldd_flags & LDD_F_VIRGIN)
                        (void) osd_label_lustre(&mop);
        }

The volume label update should be done in any case with update mtab or not.



 Comments   
Comment by Jodi Levi (Inactive) [ 30/Aug/13 ]

Alex,
Can you please comment on this ticket to let us know if this is the correct fix needed?
Thank you!

Comment by Andreas Dilger [ 30/Aug/13 ]

It looks like these few lines of code should just be moved up below the actual mount:

                for (i = 0, rc = -EAGAIN; i <= mop.mo_retry && rc != 0; i++) {
                        rc = mount(mop.mo_source, mop.mo_target, "lustre",
                                   flags, (void *)options);
                        if (rc == 0) {
                                /* change label from <fsname>:<index> to <fsname>-<index>
                                 * to indicate the device has been registered. */
                                if (mop.mo_ldd.ldd_flags & LDD_F_VIRGIN)
                                        (void)osd_label_lustre(&mop);
                        } else {
                                if (verbose) {
                                        fprintf(stderr, "%s: mount %s at %s "
                                                :
                                                :
                        }
Comment by Alexander Boyko [ 02/Sep/13 ]

Yes, this patch fix the problem.

Comment by Alex Zhuravlev [ 02/Sep/13 ]

iirc, the original reason was that tune2fs can't access a device with MMP enabled. though probably tune2fs -f will do.

Comment by Alexey Lyashkov [ 03/Sep/13 ]

Alex,

we don't understand - what you mean. You mean tunefs don't able to change a label as mount finished and MMP will protect a drive? so question - why it's need to move in userspace if it's introduce a new regression.

Comment by Alex Zhuravlev [ 03/Sep/13 ]

because of ZFS support: we use different mechanisms to store mountdata on ldiskfs and ZFS as was requested by LLNL at some point. so if we want to update mountdate from within the kernel we'd have to implement this additional ZFS-specific mechanism in the kernel as well...

Comment by Alexey Lyashkov [ 03/Sep/13 ]

we may use an any ZFS attribute to store "label" as do in other places...

Comment by Alex Zhuravlev [ 03/Sep/13 ]

we do use ZFS attributes for that (a separate one for every member of mountdata), but this is currently hidden within ZFS specific parts of the utils.
if we start to update mountdata from the kernel again we'll have to bring all these bits (including ldiskfs and zfs specifics) into the kernel.

Comment by Alexey Lyashkov [ 03/Sep/13 ]

it's was done in kernel already (before adding an regression), i don't see problem with it.

Comment by Alex Zhuravlev [ 03/Sep/13 ]

there was no ZFS support at that time.

Comment by Oleg Drokin [ 18/Sep/13 ]

Could somebody submit a patch to gerrit for this, pleaae?
We need this for 2.5

Comment by Alexander Boyko [ 20/Sep/13 ]

http://review.whamcloud.com/7712
Xyratex-bug-id: MRP-1325

Comment by Peter Jones [ 24/Sep/13 ]

Landed for 2.5.0

Generated at Sat Feb 10 01:37:30 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.