Fix for LBUG:
osp_md_create()) ASSERTION( attr->la_valid & LA_TYPE ) failed:
osp_md_create()) LBUG
Pid: 6024, comm: lod0002_rec0001 3.10.0-1062.18.1.el7_lustre
Call Trace:
libcfs_call_trace+0x8c/0xc0 [libcfs]
lbug_with_loc+0x4c/0xa0 [libcfs]
osp_md_create+0x42a/0x470 [osp]
llog_osd_get_cat_list+0x8d4/0xbd0 [obdclass]
lod_sub_prep_llog+0xb9/0x783 [lod]
lod_sub_recovery_thread+0x383/0xcf0 [lod]
kthread+0xd1/0xe0
ret_from_fork_nospec_begin+0x7/0x21
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I035f3f2da5dba54b86431cec65c48e9c5010224c
Reviewed-on: https://review.whamcloud.com/40264
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
la->la_atime = la->la_mtime = la->la_ctime = ktime_get_real_seconds();
la->la_mode = S_IFDIR | S_IRWXU;
la->la_valid = LA_ATIME | LA_MTIME | LA_CTIME | LA_MODE |
- LA_UID | LA_GID;
+ LA_UID | LA_GID | LA_TYPE;
memset(dof, 0, sizeof(*dof));
dof->dof_type = dt_mode_to_dft(S_IFDIR);
if (IS_ERR(th))
GOTO(out, rc = PTR_ERR(th));
- lgi->lgi_attr.la_valid = LA_MODE;
+ lgi->lgi_attr.la_valid = LA_MODE | LA_TYPE;
lgi->lgi_attr.la_mode = S_IFREG | S_IRUGO | S_IWUSR;
lgi->lgi_dof.dof_type = dt_mode_to_dft(S_IFREG);