Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • 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?

      Attachments

        Activity

          [LU-8579] oti_dev is never set, but is used

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/22307/
          Subject: LU-8579 osd-ldiskfs: code cleanup for osd_ldiskfs_add_entry
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 3ed0a4a64642751931fcc397511c4a118e3d1a51

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/22307/ Subject: LU-8579 osd-ldiskfs: code cleanup for osd_ldiskfs_add_entry Project: fs/lustre-release Branch: master Current Patch Set: Commit: 3ed0a4a64642751931fcc397511c4a118e3d1a51

          Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/22307
          Subject: LU-8579 osd-ldiskfs: code cleanup for osd_ldiskfs_add_entry
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 8c0f67871bea7f74dd1ca24e5e6079da8a6b3915

          gerrit Gerrit Updater added a comment - Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/22307 Subject: LU-8579 osd-ldiskfs: code cleanup for osd_ldiskfs_add_entry Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8c0f67871bea7f74dd1ca24e5e6079da8a6b3915

          Attached is the part of http://review.whamcloud.com/19865 that related to this issue that can be used when fixing this issue.

          adilger Andreas Dilger added a comment - Attached is the part of http://review.whamcloud.com/19865 that related to this issue that can be used when fixing this issue.

          People

            yong.fan nasf (Inactive)
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: