Whamcloud - gitweb
LU-9657 pfl: llapi_layout_comp_usei should handle non-pfl file
[fs/lustre-release.git] / lustre / utils / liblustreapi_layout.c
index 5df0ae6..f02bf44 100644 (file)
@@ -1841,8 +1841,11 @@ int llapi_layout_comp_use(struct llapi_layout *layout,
                return -1;
 
        if (!layout->llot_is_composite) {
-               errno = EINVAL;
-               return -1;
+               if (pos == LLAPI_LAYOUT_COMP_USE_FIRST ||
+                   pos == LLAPI_LAYOUT_COMP_USE_LAST)
+                       return 0;
+               errno = ENOENT;
+               return 1;
        }
 
        head = list_entry(layout->llot_comp_list.next, typeof(*head), llc_list);