- if (la->la_valid & (LA_SIZE | LA_BLOCKS) &&
- !(la->la_valid & LA_TRUNC)) {
- /* For "Size-on-MDS" case, the MAY_WRITE perm
- * has been checked when file open. */
-
+ /* For both Size-on-MDS case and truncate case,
+ * "la->la_valid & (LA_SIZE | LA_BLOCKS)" are ture.
+ * We distinguish them by "ma->ma_attr_flags & MDS_SOM".
+ * For SOM case, it is true, the MAY_WRITE perm has been checked
+ * when open, no need check again. For truncate case, it is false,
+ * the MAY_WRITE perm should be checked here. */
+ if (ma->ma_attr_flags & MDS_SOM) {