From: Yang Sheng Date: Thu, 15 Oct 2020 14:57:46 +0000 (+0800) Subject: LU-14039 obdclass: set LA_TYPE when update_log init X-Git-Tag: 2.13.57~81 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7aef9051f38bcb5757bc132ad7627742b74c654c LU-14039 obdclass: set LA_TYPE when update_log init 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 Change-Id: I035f3f2da5dba54b86431cec65c48e9c5010224c Reviewed-on: https://review.whamcloud.com/40264 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c index fd161e8..19f7a4d 100644 --- a/lustre/lfsck/lfsck_lib.c +++ b/lustre/lfsck/lfsck_lib.c @@ -1090,7 +1090,7 @@ static int lfsck_create_lpf(const struct lu_env *env, 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); diff --git a/lustre/obdclass/llog_osd.c b/lustre/obdclass/llog_osd.c index de00b7a..09246e50 100644 --- a/lustre/obdclass/llog_osd.c +++ b/lustre/obdclass/llog_osd.c @@ -2014,7 +2014,7 @@ int llog_osd_get_cat_list(const struct lu_env *env, struct dt_device *d, 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);