Whamcloud - gitweb
LU-11868 mdc: Improve xattr buffer allocations
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index 94a675a..5168791 100644 (file)
@@ -597,25 +597,26 @@ again:
                            exp_connect_large_acl(info->mti_exp) &&
                            buf->lb_buf != info->mti_big_acl) {
                                if (info->mti_big_acl == NULL) {
+                                       info->mti_big_aclsize =
+                                                       MIN(mdt->mdt_max_ea_size,
+                                                           XATTR_SIZE_MAX);
                                        OBD_ALLOC_LARGE(info->mti_big_acl,
-                                                       mdt->mdt_max_ea_size);
+                                                       info->mti_big_aclsize);
                                        if (info->mti_big_acl == NULL) {
+                                               info->mti_big_aclsize = 0;
                                                CERROR("%s: unable to grow "
                                                       DFID" ACL buffer\n",
                                                       mdt_obd_name(mdt),
                                                       PFID(mdt_object_fid(o)));
                                                RETURN(-ENOMEM);
                                        }
-
-                                       info->mti_big_aclsize =
-                                                       mdt->mdt_max_ea_size;
                                }
 
                                CDEBUG(D_INODE, "%s: grow the "DFID
                                       " ACL buffer to size %d\n",
                                       mdt_obd_name(mdt),
                                       PFID(mdt_object_fid(o)),
-                                      mdt->mdt_max_ea_size);
+                                      info->mti_big_aclsize);
 
                                buf->lb_buf = info->mti_big_acl;
                                buf->lb_len = info->mti_big_aclsize;
@@ -2169,7 +2170,7 @@ out_shrink:
         * Data-on-MDT optimization - read data along with OPEN and return it
         * in reply. Do that only if we have both DOM and LAYOUT locks.
         */
-       if (rc == 0 && op == REINT_OPEN &&
+       if (rc == 0 && op == REINT_OPEN && !req_is_replay(pill->rc_req) &&
            info->mti_attr.ma_lmm != NULL &&
            mdt_lmm_dom_entry(info->mti_attr.ma_lmm) == LMM_DOM_ONLY) {
                rc = mdt_dom_read_on_open(info, info->mti_mdt,
@@ -5073,7 +5074,9 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
        INIT_LIST_HEAD(&m->mdt_squash.rsi_nosquash_nids);
        init_rwsem(&m->mdt_squash.rsi_sem);
        spin_lock_init(&m->mdt_lock);
-       m->mdt_enable_remote_dir = 0;
+       m->mdt_enable_remote_dir = 1;
+       m->mdt_enable_striped_dir = 1;
+       m->mdt_enable_dir_migration = 1;
        m->mdt_enable_remote_dir_gid = 0;
 
        atomic_set(&m->mdt_mds_mds_conns, 0);