Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.9.0
-
None
-
3
-
9223372036854775807
Description
The oti_dev member of osd_thread_info is never set, but is used in a check:
int osd_ldiskfs_add_entry(struct osd_thread_info *info, handle_t *handle, struct dentry *child, struct inode *inode, struct htree_lock *hlock) { rc = __ldiskfs_add_entry(handle, child, inode, hlock); if (rc == -ENOBUFS || rc == -ENOSPC) { struct lu_fid fid = { }; : : rc2 = osd_get_lma(info, p_dentry->d_inode, p_dentry, &lma); if (rc2 == 0) { fid = lma.lma_self_fid; snprintf(fidbuf, sizeof(fidbuf), DFID, PFID(&fid)); } else if (rc2 == -ENODATA) { if (unlikely(p_dentry->d_inode == inode->i_sb->s_root->d_inode)) lu_local_obj_fid(&fid, OSD_FS_ROOT_OID); else if (info->oti_dev && !info->oti_dev->od_is_ost && fid_seq_is_mdt0(fid_seq(&fid))) lu_igif_build(&fid, p_dentry->d_inode->i_ino, p_dentry->d_inode->i_generation); snprintf(fidbuf, sizeof(fidbuf), DFID, PFID(&fid));
Because oti_dev is initialized to NULL, then the info->oti_dev check will always fail, and od_is_ost can not be verified.
Also, the fid_seq_is_mdt0(fid_seq(&fid)) check is always true, because fid.f_seq is initialized to zero at the start of the function and never changed in this codepath.
Is this just dead code and should be removed, or should something else be done to fix this bit of code?