Use own persistent buffer for changelog needs to don't
interfere with generic big_buf in MDD thread info which
can be in use.
Fixes:
f3d03bc38a ("LU-14430 mdd: fix inheritance of big default ACLs")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I4f4692b5556eaa98e2e23d7b58c925e33401e4e5
Reviewed-on: https://review.whamcloud.com/43672
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
reclen = llog_data_len(sizeof(*rec) + len);
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, reclen);
+ buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
if (buf->lb_buf == NULL)
RETURN(-ENOMEM);
rec = buf->lb_buf;
lu_buf_free(&info->mti_big_buf);
lu_buf_free(&info->mti_link_buf);
lu_buf_free(&info->mti_xattr_buf);
+ lu_buf_free(&info->mti_chlg_buf);
OBD_FREE_PTR(info);
}
return 0;
reclen = mdd_llog_record_calc_size(env, tname, sname);
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, reclen);
+ buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
if (buf->lb_buf == NULL)
return -ENOMEM;
LASSERT(handle != NULL);
reclen = mdd_llog_record_calc_size(env, tname, sname);
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, reclen);
+ buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
if (buf->lb_buf == NULL)
RETURN(-ENOMEM);
rec = buf->lb_buf;
acl_buf = *lu_buf_check_and_alloc(&info->mti_xattr_buf, acl_size);
if (!acl_buf.lb_buf)
GOTO(out_stop, rc = -ENOMEM);
- /* mti_big_buf is also used down below in mdd_changelog_ns_store(),
- * but def_acl_buf is finished with it before then
- */
+
def_acl_buf = *lu_buf_check_and_alloc(&info->mti_big_buf, acl_size);
if (!def_acl_buf.lb_buf)
GOTO(out_stop, rc = -ENOMEM);
int mti_flags;
char mti_name[NAME_MAX + 1];
struct lu_buf mti_buf[4];
- struct lu_buf mti_big_buf; /* biggish persistent buf */
+ /* persistent buffers, must be handled with lu_buf_alloc/free */
+ struct lu_buf mti_big_buf;
+ struct lu_buf mti_chlg_buf;
struct lu_buf mti_link_buf; /* buf for link ea */
struct lu_buf mti_xattr_buf;
struct obdo mti_oa;
reclen = llog_data_len(LLOG_CHANGELOG_HDR_SZ +
changelog_rec_offset(clf_flags & CLF_SUPPORTED,
xflags & CLFE_SUPPORTED));
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, reclen);
+ buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
if (buf->lb_buf == NULL)
RETURN(-ENOMEM);
rec = buf->lb_buf;
}
run_test 103e "inheritance of big amount of default ACLs"
+test_103f() {
+ (( $MDS1_VERSION >= $(version_code 2.14.51) )) ||
+ skip "MDS needs to be at least 2.14.51"
+
+ large_xattr_enabled || skip_env "ea_inode feature disabled"
+
+ # enable changelog to consume more internal MDD buffers
+ changelog_register
+
+ mkdir -p $DIR/$tdir
+ # add big LOV EA
+ $LFS setstripe -C 1000 $DIR/$tdir
+ setfacl -d -m user:$U:rwx $DIR/$tdir || error "Cannot add default ACLs"
+ mkdir $DIR/$tdir/inherited || error "failed to create subdirectory"
+ rmdir $DIR/$tdir/inherited || error "Cannot remove subdirectory"
+ rmdir $DIR/$tdir || error "Cannot remove directory"
+}
+run_test 103f "changelog doesn't interfere with default ACLs buffers"
+
test_104a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"