Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.8.0
    • Lustre 2.7.0
    • 3
    • 17351

    Description

      When calling lfs path2fid, and FID is returned between bracket. When that fid variable is used, it is then expanded by the shell to something else. For instance when it is given to fid2path, it returns an error:

      $ ../utils/lfs fid2path lustre [0x200000be7:0xb:0x0]
      bad FID format [x], should be [0x1:0x2:0x0]

      fid2path: error on FID x: Invalid argument

      This will cause some tests, such as 154A or test_238 to fail under certain conditions, such as being called with:

      ONLY=154A PDSH=ssh AGTCOUNT=1 agt1_HOST=localhost \
      NAME=local sh ./sanity.sh

      Attachments

        Activity

          [LU-6205] tests: fix bash expansion of FIDs

          There are other scripts that needs similar fix, e.g.

          == sanity-lfsck test 2a: LFSCK can find out and repair crashed linkEA entry == 02:11:11 (1452877871)
          formatall
          setupall
          preparing... 1 * 1 files will be created.
          prepared.
          stop mds1
          start mds1
          Starting client: atest-vm31: -o user_xattr,flock atest-vm32@tcp:/lustre /mnt/lustre
          fail_loc=0x1603
          fail_loc=0
          10.128.12.32@tcp:/lustre /mnt/lustre lustre rw,flock,user_xattr 0 0
          Stopping client atest-vm31 /mnt/lustre (opts
          Started LFSCK on the device lustre-MDT0000: namespace.
          Starting client: atest-vm31: -o user_xattr,flock atest-vm32@tcp:/lustre /mnt/lustre
          bad FID format [b], should be [0x1:0x2:0x0]

          fid2path: error on FID b: Invalid argument
          sanity-lfsck test_2a: @@@@@@ FAIL: (8) Fail to repair linkEA: [0x280000bd0:0x1:0x0]
          Trace dump:
          = /usr/lib64/lustre/tests/test-framework.sh:4421:error_noexit()
          = /usr/lib64/lustre/tests/test-framework.sh:4452:error()
          = /usr/lib64/lustre/tests/sanity-lfsck.sh:262:test_2a()
          = /usr/lib64/lustre/tests/test-framework.sh:4691:run_one()
          = /usr/lib64/lustre/tests/test-framework.sh:4728:run_one_logged()
          = /usr/lib64/lustre/tests/test-framework.sh:4594:run_test()
          = /usr/lib64/lustre/tests/sanity-lfsck.sh:264:main()
          Dumping lctl log to /tmp/test_logs/logdir_1007_sanity-lfsck_1/sanity-lfsck.test_2a.*.1452877964.log

          lixi Li Xi (Inactive) added a comment - There are other scripts that needs similar fix, e.g. == sanity-lfsck test 2a: LFSCK can find out and repair crashed linkEA entry == 02:11:11 (1452877871) formatall setupall preparing... 1 * 1 files will be created. prepared. stop mds1 start mds1 Starting client: atest-vm31: -o user_xattr,flock atest-vm32@tcp:/lustre /mnt/lustre fail_loc=0x1603 fail_loc=0 10.128.12.32@tcp:/lustre /mnt/lustre lustre rw,flock,user_xattr 0 0 Stopping client atest-vm31 /mnt/lustre (opts Started LFSCK on the device lustre-MDT0000: namespace. Starting client: atest-vm31: -o user_xattr,flock atest-vm32@tcp:/lustre /mnt/lustre bad FID format [b] , should be [0x1:0x2:0x0] fid2path: error on FID b: Invalid argument sanity-lfsck test_2a: @@@@@@ FAIL: (8) Fail to repair linkEA: [0x280000bd0:0x1:0x0] Trace dump: = /usr/lib64/lustre/tests/test-framework.sh:4421:error_noexit() = /usr/lib64/lustre/tests/test-framework.sh:4452:error() = /usr/lib64/lustre/tests/sanity-lfsck.sh:262:test_2a() = /usr/lib64/lustre/tests/test-framework.sh:4691:run_one() = /usr/lib64/lustre/tests/test-framework.sh:4728:run_one_logged() = /usr/lib64/lustre/tests/test-framework.sh:4594:run_test() = /usr/lib64/lustre/tests/sanity-lfsck.sh:264:main() Dumping lctl log to /tmp/test_logs/logdir_1007_sanity-lfsck_1/sanity-lfsck.test_2a.*.1452877964.log

          Landed to master (pre-2.8.0)

          jamesanunez James Nunez (Inactive) added a comment - Landed to master (pre-2.8.0)

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13618/
          Subject: LU-6205 tests: fix bash expansion of fid
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: fd3bfcd73ee93e356adb716b11feca4bfd860af4

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13618/ Subject: LU-6205 tests: fix bash expansion of fid Project: fs/lustre-release Branch: master Current Patch Set: Commit: fd3bfcd73ee93e356adb716b11feca4bfd860af4
          rread Robert Read added a comment -

          doh!

          rread Robert Read added a comment - doh!
          fzago Frank Zago (Inactive) added a comment - - edited

          Robert, create a file "a" and try again.

          # v=[0x200000400:0x4a:0x0]
          # lfs fid2path lustre $v
          fid2path: error on FID [0x200000400:0x4a:0x0]: No such file or directory
          # touch a
          # lfs fid2path lustre $v
          bad FID format [a], should be [0x1:0x2:0x0]
          
          fid2path: error on FID a: Invalid argument
          
          fzago Frank Zago (Inactive) added a comment - - edited Robert, create a file "a" and try again. # v=[0x200000400:0x4a:0x0] # lfs fid2path lustre $v fid2path: error on FID [0x200000400:0x4a:0x0]: No such file or directory # touch a # lfs fid2path lustre $v bad FID format [a], should be [0x1:0x2:0x0] fid2path: error on FID a: Invalid argument

          Your sample fails for me:

          # lustre/utils/lfs fid2path lustre [0x200000400:0x4a:0x0]
          bad FID format [a], should be [0x1:0x2:0x0]
          
          # v=[0x200000400:0x4a:0x0]
          [root@c65-l251-intel-fzago lustre-cleanup]# lustre/utils/lfs fid2path lustre $v
          bad FID format [a], should be [0x1:0x2:0x0]
          

          I'm running bash on centos 6.5.

          fzago Frank Zago (Inactive) added a comment - Your sample fails for me: # lustre/utils/lfs fid2path lustre [0x200000400:0x4a:0x0] bad FID format [a], should be [0x1:0x2:0x0] # v=[0x200000400:0x4a:0x0] [root@c65-l251-intel-fzago lustre-cleanup]# lustre/utils/lfs fid2path lustre $v bad FID format [a], should be [0x1:0x2:0x0] I'm running bash on centos 6.5.
          rread Robert Read added a comment -

          I can't figure out how to make this fail. Do you have a simple reproducer for this?

          [root@test1 lustre]# touch foo
          [root@test1 lustre]# lfs path2fid foo
          [0x200000400:0x4a:0x0]
          [root@test1 lustre]# lfs fid2path lustre [0x200000400:0x4a:0x0]
          foo
          [root@test1 lustre]# v=[0x200000400:0x4a:0x0]
          [root@test1 lustre]# lfs fid2path lustre $v
          foo
          
          rread Robert Read added a comment - I can't figure out how to make this fail. Do you have a simple reproducer for this? [root@test1 lustre]# touch foo [root@test1 lustre]# lfs path2fid foo [0x200000400:0x4a:0x0] [root@test1 lustre]# lfs fid2path lustre [0x200000400:0x4a:0x0] foo [root@test1 lustre]# v=[0x200000400:0x4a:0x0] [root@test1 lustre]# lfs fid2path lustre $v foo

          frank zago (fzago@cray.com) uploaded a new patch: http://review.whamcloud.com/13618
          Subject: LU-6205 tests: fix bash expansion of fid
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: aa99d73b66d377c0d5bad798eafbb25b0413b524

          gerrit Gerrit Updater added a comment - frank zago (fzago@cray.com) uploaded a new patch: http://review.whamcloud.com/13618 Subject: LU-6205 tests: fix bash expansion of fid Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: aa99d73b66d377c0d5bad798eafbb25b0413b524

          People

            wc-triage WC Triage
            fzago Frank Zago (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: