[LU-7964] tracking whether there is a direct application usage of regular file LL_IOC_LOV_GETSTRIPE ioctl interface Created: 31/Mar/16  Updated: 31/Oct/19  Resolved: 31/Oct/19

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

Type: Bug Priority: Minor
Reporter: Zhenyu Xu Assignee: Zhenyu Xu
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Related
is related to LU-9490 MPI-IO Lustre ADIO driver gets Lustre... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Lustre liblustreapi does not use the regular file's getstripe interface, I'm thinking that we could get rid of the interface. And this ticket is for tracking whether there is any application uses this interface.



 Comments   
Comment by Gerrit Updater [ 31/Mar/16 ]

Bobi Jam (bobijam@hotmail.com) uploaded a new patch: http://review.whamcloud.com/19257
Subject: LU-7964 llite: add a deprecation console message
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 18c080edeef315b49f465f1f1fc47d5eb8a1f0d8

Comment by Zhenyu Xu [ 01/Apr/16 ]

no, this does not change the liblustre APIs

Comment by Robert Read (Inactive) [ 01/Apr/16 ]

What is difference between LL_IOC_LOV_GETSTRIPE and IOC_MDC_GETFILESTRIPE?

Comment by Zhenyu Xu [ 01/Apr/16 ]

According to the code, LL_IOC_LOV_GETSTRIPE is act upon the opened file handle, and IOC_MDC_GETFILESTRIPE is upon the parent fd, and the filename of interest is passed in the user buffer.

Comment by Robert Read (Inactive) [ 01/Apr/16 ]

It seems both are useful then, just for different use cases. I would agree that LL_IOC_LOV_GETSTRIPE is redundant with the lustre.lov extended attribute, except there is bug LDEV-310 which means lustre.lov incorrect for released files. Could we fix that one first before removing this, and then applications can read EA instead?

Comment by James A Simmons [ 01/Apr/16 ]

At one time I looked to moving lfs [s|g]etstripe to the layout api but I found problem which prevented this. See LU-2809 for details.

Comment by Robert Read (Inactive) [ 01/Apr/16 ]

That's interesting, so since there is an actual difference between the xattr and ioctl, then it seems it may be worth keeping this one around until at least lov_user_md_v4 appears and we have parity between xattr and ioctl.

BTW, the issue I reported in LDEV-310 is stripe_count is 0 in xattr for a released file, but is still set when using ioctl. I suspect that is a bug and not intentional like LU-2809, but I haven't tracked it down. Oh, and I'm assuming/hoping that being 0 in xattr is the bug, not the other way around.

Comment by Andreas Dilger [ 17/May/17 ]

One important application that is using LL_IOC_LOV_GETSTRIPE is the MPI-IO library's ADIO Lustre driver, in order to determine optimal file layout for collective IO across multiple clients. Sadly, it is dereferencing the returned struct directly without checking the lmm_magic to see if the returned struct is even something it understands. It should have stopped using direct ioctl() access ages ago, and moved over to llapi_layout_get_by_path() to extract the stripe count and such.

Comment by Andreas Dilger [ 11/Nov/17 ]

I see in recent testing that LL_IOC_LOV_GETSTRIPE is still being used, even by code in the Lustre tree itself, since it is triggering the error message on the console:

lfs: using old ioctl(LL_IOC_LOV_GETSTRIPE) on [0x2000061c2:0x24:0x0], use llapi_layout_get_by_path()
static int cb_getstripe(char *path, DIR *parent, DIR **dirp, void *data,
                        struct dirent64 *de)
{
        struct find_param *param = (struct find_param *)data;
        DIR *d = dirp == NULL ? NULL : *dirp;
        int ret = 0;
:
:                       
        if (d) {
                if (param->fp_get_lmv || param->fp_get_default_lmv) {
                        ret = cb_get_dirstripe(path, d, param);
                } else {
                        ret = ioctl(dirfd(d), LL_IOC_LOV_GETSTRIPE,
                                     (void *)&param->fp_lmd->lmd_lmm);
Comment by Andreas Dilger [ 31/Oct/19 ]

Won't deprecate this interface for now.

Generated at Sat Feb 10 02:13:26 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.