[LU-14637] mirror_extend() should not sanity-check the layout of the file Created: 23/Apr/21  Updated: 14/Oct/23  Resolved: 29/Jul/21

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

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: bjhpflr

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In mirror_extend() we call mirror_create_sanity_check(fname, mirror_list) to sanity check the layouts of the original file and the mirror list. It doesn't make sense to check the layout of the original file. The check of the original file was added to prevent mixing of DoM and FLR. But the DoM+FLR prevention inside of mirror_create_sanity_check() has been removed:

static int mirror_extend(char *fname, struct mirror_args *mirror_list,
                         enum mirror_flags mirror_flags)
{
        int rc;

        rc = mirror_create_sanity_check(fname, mirror_list);
        if (rc)
                return rc;

...
}

# git-grep-and-blame mirror_create_sanity_check
125f98fb (Jian Yu 2017-09-15 21:43:10 +0000 1609)  * mirror_create_sanity_check() - Check mirror list.
0bff64be (Jinshan Xiong 2017-11-16 23:06:24 -0800 1617) static int mirror_create_sanity_check(const char *fname,
0bff64be (Jinshan Xiong 2017-11-16 23:06:24 -0800 1726) 	rc = mirror_create_sanity_check(NULL, mirror_list);
0bff64be (Jinshan Xiong 2017-11-16 23:06:24 -0800 2027) 	rc = mirror_create_sanity_check(fname, mirror_list);
# git show 0bff64be
commit 0bff64be320fd95d80ae21b1362e1a2892bd450a
Author: Jinshan Xiong <jinshan.xiong@intel.com>
Date:   Thu Nov 16 23:06:24 2017 -0800

    LU-9771 flr: to not support dom+flr for phase 1
    
    To exclude the support of dom+flr.
    
    Test-Parameters: testlist=sanity-flr
...

Removing the check on the original file will save us an open+close+etc.



 Comments   
Comment by John Hammond [ 23/Apr/21 ]

lfs mirror extend is actually opening the file twice O_RDONLY to get the layout and then once O_RDWR to actually add the mirror. The first time we get the layout it is for the sanity check and the second it to have the mirror layout inherit from the original.

Comment by Gerrit Updater [ 08/Jul/21 ]

Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/44185
Subject: LU-14637 flr: get rid of excluding dom+flr support test
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 029326afafa0f45afb4f3260c31dacdc3089a48f

Comment by Gerrit Updater [ 27/Jul/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/44185/
Subject: LU-14637 flr: get rid of excluding dom+flr support test
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 4b52ea1d30b45900787271c4c035fad124abf34a

Comment by Peter Jones [ 29/Jul/21 ]

Landed for 2.15

Generated at Sat Feb 10 03:11:27 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.