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
          pjones Peter Jones made changes -
          Link Original: This issue is related to JFC-10 [ JFC-10 ]
          pjones Peter Jones made changes -
          Link New: This issue is related to JFC-20 [ JFC-20 ]
          pjones Peter Jones made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]

          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
          pjones Peter Jones made changes -
          Link New: This issue is related to JFC-10 [ JFC-10 ]
          pjones Peter Jones made changes -
          Link Original: This issue is related to JFC-20 [ JFC-20 ]
          pjones Peter Jones made changes -
          Fix Version/s New: Lustre 2.14.0 [ 14490 ]
          pjones Peter Jones made changes -
          Fix Version/s Original: Lustre 2.13.0 [ 14290 ]
          Fix Version/s Original: Lustre 2.12.3 [ 14418 ]
          pjones Peter Jones made changes -
          Assignee Original: Patrick Farrell [ pfarrell ] New: Zhenyu Xu [ bobijam ]
          pjones Peter Jones made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: