}
}
-int llapi_file_get_stripe(const char *path, struct lov_user_md *lum)
+static int llapi_file_get_stripe1(const char *path, struct lov_user_md *lum)
{
const char *fname;
char *dname;
return rc;
}
+int llapi_file_get_stripe(const char *path, struct lov_user_md *lum)
+{
+ char *canon_path = NULL;
+ int rc, rc2;
+
+ rc = llapi_file_get_stripe1(path, lum);
+ if (!(rc == -ENOTTY || rc == -ENODATA))
+ goto out;
+
+ /* Handle failure due to symlinks by dereferencing path manually. */
+ canon_path = canonicalize_file_name(path);
+ if (canon_path == NULL)
+ goto out; /* Keep original rc. */
+
+ rc2 = llapi_file_get_stripe1(canon_path, lum);
+ if (rc2 < 0)
+ goto out; /* Keep original rc. */
+
+ rc = 0;
+out:
+ free(canon_path);
+
+ return rc;
+}
+
int llapi_file_lookup(int dirfd, const char *name)
{
struct obd_ioctl_data data = { 0 };