The removal of the explicit ioctl(OBD_IOC_GETNAME_OLD) fallback
in llapi_file_fget_lov_uuid() caused 'lfs getname' to break when
running against an 2.14 mountpoint missing OBD_IOC_GETDTNAME.
Change this to call llapi_ioctl(OBD_IOC_GETDTNAME) which handles
this compatibility mapping internally.
Also fix the include header ordering to ensure LUSTRE_VERSION_CODE
is defined before including lustre_ioctl_old.h.
Test-Parameters: trivial
Fixes:
0f38a0b9db ("LU-13107 uapi: remove obsolete ioctls")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I944acd498a42ba4882c8391e27f4156cb63ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53867
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
int rc;
- rc = ioctl(fd, OBD_IOC_GETDTNAME, lov_name);
+ rc = llapi_ioctl(fd, OBD_IOC_GETDTNAME, lov_name);
if (rc) {
rc = -errno;
llapi_error(LLAPI_MSG_ERROR, rc, "cannot get lov name");
#include <lustre/lustreapi.h>
#include <libcfs/util/ioctl.h>
#include <linux/lustre/lustre_ioctl.h>
-#include <lustre_ioctl_old.h>
#include <linux/lustre/lustre_ver.h>
+#include <lustre_ioctl_old.h>
#include "lustreapi_internal.h"
* Version in comment is to allow finding this code for later removal.
*/
#ifdef OBD_IOC_GETNAME_OLD /* < OBD_OCD_VERSION(2, 18, 53, 0) */
- case OBD_IOC_GETMDNAME:
+ case OBD_IOC_GETDTNAME:
oldcmd = OBD_IOC_GETNAME_OLD;
break;
#endif