[LU-12586] truncate to start of uninstantiated PFL component silently fails Created: 24/Jul/19 Updated: 19/Dec/20 Resolved: 01/Aug/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.13.0, Lustre 2.12.2, Lustre 2.10.8 |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Patrick Farrell (Inactive) | Assignee: | Zhenyu Xu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 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. |
| Comments |
| Comment by Gerrit Updater [ 24/Jul/19 ] |
|
Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35607 |
| Comment by Gerrit Updater [ 15/Aug/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35607/ |
| Comment by Peter Jones [ 15/Aug/19 ] |
|
Landed for 2.13 |
| Comment by Gerrit Updater [ 19/Aug/19 ] |
|
Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35836 |
| Comment by Gerrit Updater [ 04/Sep/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35836/ |
| Comment by Gerrit Updater [ 29/Apr/20 ] |
|
Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/38412 |
| Comment by Zhenyu Xu [ 29/Apr/20 ] |
|
An omission of the patch setting truncate write intent extent is pushed at https://review.whamcloud.com/#/c/38412/ |
| Comment by Gerrit Updater [ 17/Jul/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38412/ |