[LU-13693] lfs getstripe should avoid opening regular files Created: 17/Jun/20  Updated: 04/Dec/21  Resolved: 23/Jun/20

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

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-14623 sanity test_210: FAIL: multiop failed... Open
is related to LU-14322 Interop: sanityn test 51e fails with ... Resolved
is related to LU-11264 llapi_* routines demonstrate poor per... Open
is related to LU-13668 open-for-read should not conflict wit... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

lfs getstripe uses an ioctl on the parent directory to get the file striping but still opens the file to call the OBD_IOC_GETNAME ioctl in get_mds_md_size(). Rather than doing this we should just use a large enough size for the lum buffer. This avoids interfering with existing file locks and leases on the file.



 Comments   
Comment by Gerrit Updater [ 18/Jun/20 ]

John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38979
Subject: LU-13693 lfs: avoid opening regular files for getstripe
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 9f8dce9f48ec3078fc798393e75ccd276bc30948

Comment by Andreas Dilger [ 18/Jun/20 ]

Does it make sense to check in ll_lov_getstripe_ea_info() if the filename is already in the client dcache and get the xattr directly from the client cache, something like:

        qstr = QSTR_INIT(filename, strlen(filename));
        dchild = d_lookup(dparent, &qstr);

(dparent can be passed from the caller). The benefit of this would depend on whether the file is typically already present on the client when "lfs getstripe" is called or not, but the dcache lookup would be much lower overhead than an RPC (an O(1) lockless hash table lookup for the dcache these days).

Comment by Gerrit Updater [ 23/Jun/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38979/
Subject: LU-13693 lfs: avoid opening regular files for getstripe
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3eff6bada2bc789fe6089e792e4043ef7ec8396f

Comment by Peter Jones [ 23/Jun/20 ]

Landed for 2.14

Comment by Gerrit Updater [ 23/Jun/20 ]

John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39159
Subject: LU-13693 lfs: check early for MDS_OPEN_DIRECTORY
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 9f9de2072416a3f66583c4cbfb3d405abe2f3f13

Comment by Gerrit Updater [ 04/Jul/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39159/
Subject: LU-13693 lfs: check early for MDS_OPEN_DIRECTORY
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3ea729fe822d3c39df6d8a5fb530dd8a6901c91c

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