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

truncate to start of uninstantiated PFL component silently fails

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.14.0
    • Lustre 2.13.0, Lustre 2.12.2, Lustre 2.10.8
    • None
    • 3
    • 9223372036854775807

    Description

      Truncate to exactly the first byte of an uninstantiated PFL component doesn't work - It has no effect.

      Example:

      [root@cent7c02 lustre]# mkdir testdir; lfs setstripe -E 4M --stripe-count=1 -E -1 testdir
      [root@cent7c02 lustre]# touch testdir/testfile; lfs getstripe testdir/testfile
      testdir/testfile
        lcm_layout_gen:    2
        lcm_mirror_count:  1
        lcm_entry_count:   2
          lcme_id:             1
          lcme_mirror_id:      0
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   4194304
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 0
            lmm_objects:
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x24b:0x0] }    lcme_id:             2
          lcme_mirror_id:      0
          lcme_flags:          0
          lcme_extent.e_start: 4194304
          lcme_extent.e_end:   EOF
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: -1[root@cent7c02 lustre]# truncate --size 4194304 testdir/testfile; ls -la testdir/testfile
      -rw-r--r-- 1 root root 0 Jul 24 15:11 testdir/testfile
      [root@cent7c02 lustre]# truncate --size 4194303 testdir/testfile; ls -la testdir/testfile
      -rw-r--r-- 1 root root 4194303 Jul 24 15:11 testdir/testfile
      [root@cent7c02 lustre]# truncate --size 4194305 testdir/testfile; ls -la testdir/testfile
      -rw-r--r-- 1 root root 4194305 Jul 24 15:11 testdir/testfile 

      Notice that the truncate to 4 MiB (4194304) leaves the size at 0, but truncate to 4194303 or 4194305 works fine.

      Once the component is instantiated, this works fine:

      [root@cent7c02 lustre]# truncate --size 4194305 testdir/testfile; ls -la testdir/testfile
      -rw-r--r-- 1 root root 4194305 Jul 24 15:14 testdir/testfile
      [root@cent7c02 lustre]# lfs getstripe testdir/testfile
      testdir/testfile
        lcm_layout_gen:    3
        lcm_mirror_count:  1
        lcm_entry_count:   2
          lcme_id:             1
          lcme_mirror_id:      0
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   4194304
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 1
            lmm_objects:
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0x24d:0x0] }    lcme_id:             2
          lcme_mirror_id:      0
          lcme_flags:          init
          lcme_extent.e_start: 4194304
          lcme_extent.e_end:   EOF
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 0
            lmm_objects:
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x24e:0x0] }
      [root@cent7c02 lustre]# truncate --size 4194304 testdir/testfile; ls -la testdir/testfile
      -rw-r--r-- 1 root root 4194304 Jul 24 15:14 testdir/testfile 

      This is due to a slightly mixup in the write intent code between "end" for truncate, which is a size, and "end" for a normal write, which is actually "endpos", ie, the position of the write cursor after a write, which is not actually accessed and so does not need to be instantiated.  But "end" for truncate is not endpos, it's end, ie, it's included.

      Fix coming momentarily.

      Attachments

        Activity

          [LU-12586] truncate to start of uninstantiated PFL component silently fails

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38412/
          Subject: LU-12586 lov: one more fix to write_intent end for trunc
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 8ecf9e229cf59def03bb9368ec88228ff6e943f0

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38412/ Subject: LU-12586 lov: one more fix to write_intent end for trunc Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8ecf9e229cf59def03bb9368ec88228ff6e943f0
          bobijam Zhenyu Xu added a comment -

          An omission of the patch setting truncate write intent extent is pushed at https://review.whamcloud.com/#/c/38412/

          bobijam Zhenyu Xu added a comment - An omission of the patch setting truncate write intent extent is pushed at https://review.whamcloud.com/#/c/38412/

          Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/38412
          Subject: LU-12586 lov: Correct write_intent end for trunc
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 9276069349fbb7f4d81d26873e24cab52e128912

          gerrit Gerrit Updater added a comment - Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/38412 Subject: LU-12586 lov: Correct write_intent end for trunc Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 9276069349fbb7f4d81d26873e24cab52e128912

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35836/
          Subject: LU-12586 lov: Correct write_intent end for trunc
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set:
          Commit: ad52ac24a1d7969bfa007def9992110cf4c0888a

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35836/ Subject: LU-12586 lov: Correct write_intent end for trunc Project: fs/lustre-release Branch: b2_12 Current Patch Set: Commit: ad52ac24a1d7969bfa007def9992110cf4c0888a

          Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35836
          Subject: LU-12586 lov: Correct write_intent end for trunc
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set: 1
          Commit: 289d1e93d4cbf7be9757475dd0d222835e11d967

          gerrit Gerrit Updater added a comment - Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35836 Subject: LU-12586 lov: Correct write_intent end for trunc Project: fs/lustre-release Branch: b2_12 Current Patch Set: 1 Commit: 289d1e93d4cbf7be9757475dd0d222835e11d967
          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/35607/
          Subject: LU-12586 lov: Correct write_intent end for trunc
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: c32c7401426d46b371fa993bba17265443fefa1b

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35607/ Subject: LU-12586 lov: Correct write_intent end for trunc Project: fs/lustre-release Branch: master Current Patch Set: Commit: c32c7401426d46b371fa993bba17265443fefa1b

          Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35607
          Subject: LU-12586 lov: Correct write_intent end for trunc
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 38aa7eb4578a204658eafc923da2aba1e7bbac36

          gerrit Gerrit Updater added a comment - Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35607 Subject: LU-12586 lov: Correct write_intent end for trunc Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 38aa7eb4578a204658eafc923da2aba1e7bbac36

          People

            bobijam Zhenyu Xu
            pfarrell Patrick Farrell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: