Whamcloud - gitweb
LU-12564 libcfs: Use vfree_atomic instead of vfree
[fs/lustre-release.git] / lustre / utils / liblustreapi_layout.c
index c2cd0ad..3f85197 100644 (file)
@@ -3110,6 +3110,10 @@ struct llapi_layout_sanity_args {
        int lsa_rc;
 };
 
+/* The component flags can be set by users at creation/modification time. */
+#define LCME_USER_COMP_FLAGS   (LCME_FL_PREF_RW | LCME_FL_NOSYNC | \
+                                LCME_FL_EXTENSION)
+
 static int llapi_layout_sanity_cb(struct llapi_layout *layout,
                                  void *arg)
 {
@@ -3175,7 +3179,8 @@ static int llapi_layout_sanity_cb(struct llapi_layout *layout,
                        if (comp->llc_flags & ~LCME_USER_COMP_FLAGS)
                                args->lsa_rc = LSE_FLAGS;
                } else {
-                       if (comp->llc_flags & ~LCME_FL_EXTENSION)
+                       if (comp->llc_flags &
+                           ~(LCME_FL_EXTENSION | LCME_FL_PREF_RW))
                                args->lsa_rc = LSE_FLAGS;
                }
        }
@@ -3426,7 +3431,9 @@ int llapi_get_lum_file_fd(int dir_fd, const char *fname, __u64 *valid,
        if (rc)
                return rc;
 
-       *valid = lmd->lmd_flags;
+       if (valid)
+               *valid = lmd->lmd_flags;
+
        if (statx)
                memcpy(statx, &lmd->lmd_stx, sizeof(*statx));