Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12650

get_root_path() filesystem name compare error that leads to fid2path fail

Details

    • 3
    • 9223372036854775807

    Description

      get_root_path() returns (for instance) path to "lustre" mount instead "lustre1"
      because last symbol is not taking in account during comparison.
      This bug has influence to get_root_path() users.

      For example, fid2path use get_root_path().

      mount -t lustre
       /dev/mapper/mds1_flakey on /mnt/lustre-mds1 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre-MDT0000,mgs,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
       /dev/mapper/ost1_flakey on /mnt/lustre-ost1 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre-OST0000,mgsnode=192.168.1.227@tcp,osd=osd-ldiskfs,errors=remount-ro)
       /dev/mapper/ost2_flakey on /mnt/lustre-ost2 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre-OST0001,mgsnode=192.168.1.227@tcp,osd=osd-ldiskfs,errors=remount-ro)
       192.168.1.227@tcp:/lustre on /mnt/lustre type lustre (rw,seclabel,flock,user_xattr,lazystatfs)
       /tmp/lustre2-mdt on /mnt/lustre2-mds1 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre2-MDT0000,mgsnode=192.168.1.227@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
       /tmp/lustre2-ost1 on /mnt/lustre2-ost1 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre2-OST0000,mgsnode=192.168.1.227@tcp,osd=osd-ldiskfs,errors=remount-ro)
       /tmp/lustre2-ost2 on /mnt/lustre2-ost2 type lustre (ro,context=unconfined_u:object_r:user_tmp_t:s0,svname=lustre2-OST0001,mgsnode=192.168.1.227@tcp,osd=osd-ldiskfs,errors=remount-ro)
       192.168.1.227@tcp:/lustre2 on /mnt/lustre2 type lustre (rw,seclabel,flock,lazystatfs)
      lfs path2fid /mnt/lustre2/foodir3
       [0x200000401:0x1:0x0]
      
      lfs fid2path lustre2 [0x200000401:0x1:0x0]
       lfs fid2path: cannot find '[0x200000401:0x1:0x0]': No such file or
       directory
      
      umount /mnt/lustre
       lfs fid2path lustre2 [0x200000401:0x1:0x0]
       foodir3
      

      Attachments

        Activity

          [LU-12650] get_root_path() filesystem name compare error that leads to fid2path fail

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36211/
          Subject: LU-12650 lib: fix strings comparison during mount searching
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set:
          Commit: 9ab5dc7b1f3d3814b6d876e427c56415e8c7bb8a

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36211/ Subject: LU-12650 lib: fix strings comparison during mount searching Project: fs/lustre-release Branch: b2_12 Current Patch Set: Commit: 9ab5dc7b1f3d3814b6d876e427c56415e8c7bb8a

          Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36211
          Subject: LU-12650 lib: fix strings comparison during mount searching
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set: 1
          Commit: 8253429de7c6bfd03e250e6395d76d143aeb3f77

          gerrit Gerrit Updater added a comment - Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36211 Subject: LU-12650 lib: fix strings comparison during mount searching Project: fs/lustre-release Branch: b2_12 Current Patch Set: 1 Commit: 8253429de7c6bfd03e250e6395d76d143aeb3f77
          pjones Peter Jones added a comment -

          Landed for 2.13

          pjones Peter Jones added a comment - Landed for 2.13

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35755/
          Subject: LU-12650 lib: fix strings comparison during mount searching
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 0817efd73f04bf59d1234887bc3971d2d067067e

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35755/ Subject: LU-12650 lib: fix strings comparison during mount searching Project: fs/lustre-release Branch: master Current Patch Set: Commit: 0817efd73f04bf59d1234887bc3971d2d067067e

          adilger , thanks for pointing to right solution. I uploaded solution I used to fix this issue here, because it is ready and works. But sure, we can make other patch or both.

          Patch above can be useful for other get_root_path() users. We need to deleted this function or fix.

          artem_blagodarenko Artem Blagodarenko (Inactive) added a comment - - edited adilger , thanks for pointing to right solution. I uploaded solution I used to fix this issue here, because it is ready and works. But sure, we can make other patch or both. Patch above can be useful for other get_root_path() users. We need to deleted this function or fix.

          > can you check that with master branch, please?
          The experiment from description was executed on master.

          artem_blagodarenko Artem Blagodarenko (Inactive) added a comment - > can you check that with master branch, please? The experiment from description was executed on master.

          Artem Blagodarenko (c17828@cray.com) uploaded a new patch: https://review.whamcloud.com/35755
          Subject: LU-12650 lib: fix strings comparison during mount searching
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 23ae1d0acaaf9385cfbcd93223a8f14bf0850faf

          gerrit Gerrit Updater added a comment - Artem Blagodarenko (c17828@cray.com) uploaded a new patch: https://review.whamcloud.com/35755 Subject: LU-12650 lib: fix strings comparison during mount searching Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 23ae1d0acaaf9385cfbcd93223a8f14bf0850faf

          I'd prefer removing get_root_path() as much as possible. Instead of extracting the fsname from /proc/mounts via a complex scan, we can call a single ioctl() to get the filesystem name directly from any file/directory in the filesystem.

          For example, patch https://review.whamcloud.com/35451 "LU-12521 llapi: add separate fsname and instance" adds more useful interfaces that get the fsname and instance directly from the kernel.

          adilger Andreas Dilger added a comment - I'd prefer removing get_root_path() as much as possible. Instead of extracting the fsname from /proc/mounts via a complex scan, we can call a single ioctl() to get the filesystem name directly from any file/directory in the filesystem. For example, patch https://review.whamcloud.com/35451 " LU-12521 llapi: add separate fsname and instance " adds more useful interfaces that get the fsname and instance directly from the kernel.

          can you check that with master branch, please?

          bzzz Alex Zhuravlev added a comment - can you check that with master branch, please?

          On 2.7 this bug leads to changeling errors. lfs changeling returns information from wrong fs. In muster, changeling completely rewritten, so only fid2path (probably other commands) are failed.

          artem_blagodarenko Artem Blagodarenko (Inactive) added a comment - On 2.7 this bug leads to changeling errors. lfs changeling returns information from wrong fs. In muster, changeling completely rewritten, so only fid2path (probably other commands) are failed.

          People

            artem_blagodarenko Artem Blagodarenko (Inactive)
            artem_blagodarenko Artem Blagodarenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: