[LU-16537] osd-ldiskfs prevents writing of last block of very large ldiskfs file Created: 07/Feb/23  Updated: 02/Jan/24

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Vladimir Saveliev Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
is related to LU-14384 data "written" to last stripe of very... Open
is related to LU-16812 ldiskfs osd_punch() should check new ... Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

4k ext4/ldiskfs files are 4294967295 blocks long. Last block never gets written due to a bug in osd_ldiskfs_map_inode_pages():

                if (fp->index + clen >= max_page_index)
                        GOTO(cleanup, rc = -EFBIG);


 Comments   
Comment by Gerrit Updater [ 07/Feb/23 ]

"Vladimir Saveliev <vladimir.saveliev@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49933
Subject: LU-16537 osd-ldiskfs: allow write of last block of a file
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: be87b6bea275f17f9fa5197d170fe91e7520635e

Comment by Vladimir Saveliev [ 28/Feb/23 ]

Patch set 2 includes 4 tests which fail as shown below (when ran without fixes):

ZFS:

# REFORMAT=yes ONLY="44c 44d" FSTYPE=zfs bash /usr/lib64/lustre/tests/sanity.sh
…
== sanity test 44c: write 1 byte at max_object_bytes - 1 offset ========================================================== 14:59:45 (1677589185)
1+0 records in
1+0 records out
1 byte copied, 0.00192591 s, 0.5 kB/s
/mnt/lustre/f44c.sanity has size 0, not 9223372036854775807
 sanity test_44c: @@@@@@ FAIL: wrong size
  Trace dump:
...
FAIL 44c (0s)

== sanity test 44d: if write at position fails (EFBIG), so should do append ========================================================== 14:59:46 (1677589186)
dd: error writing '/mnt/lustre/f44d.sanity': File too large
1+0 records in
0+0 records out
0 bytes copied, 0.00126738 s, 0.0 kB/s
1+0 records in
1+0 records out
1 byte copied, 0.000872801 s, 1.1 kB/s
 sanity test_44d: @@@@@@ FAIL: one of dd commands failed
  Trace dump:
...
FAIL 44d (0s)

LDISKFS:

# RUNAS_ID=1000 REFORMAT=yes ONLY="44b 44e" FSTYPE=ldiskfs bash /usr/lib64/lustre/tests/sanity.sh
…
== sanity test 44b: write one byte at offset 0xfffffffe000 ========================================================== 15:01:48 (1677589308)
1+0 records in
1+0 records out
1 byte copied, 0.00301143 s, 0.3 kB/s
/mnt/lustre/f44b.sanity has size 0, not 17592186036225
 sanity test_44b: @@@@@@ FAIL: wrong size
  Trace dump:
...
FAIL 44b (0s)

== sanity test 44e: write and read maximal stripes ======= 15:01:48 (1677589308)
1+0 records in
1+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0646687 s, 32.4 MB/s
1+0 records in
1+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0396179 s, 52.9 MB/s
/tmp/f44e.sanity /mnt/lustre/f44e.sanity differ: byte 8193, line 45
cmp: /mnt/lustre/f44e.sanity: Input/output error
 sanity test_44e: @@@@@@ FAIL: cmp failed
  Trace dump:
...
FAIL 44e (2s)
Comment by Gerrit Updater [ 02/Jan/24 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53569
Subject: LU-16537 test: sanity/44e tmpfile cmp
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7770641e4be3bad6c2a123d18c3a8a5b80db4260

Generated at Sat Feb 10 03:27:52 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.