Whamcloud - gitweb
LU-14155 mdc: avoid easize set to 0
[fs/lustre-release.git] / lustre / utils / liblustreapi_layout.c
index 5dfd6f4..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;
                }
        }