[LU-14267] osd_ldiskfs_write_record(): do not update in-bh inode every time Created: 22/Dec/20  Updated: 08/Jan/21  Resolved: 05/Jan/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.14.0, Lustre 2.12.6
Fix Version/s: Lustre 2.14.0

Type: Bug Priority: Critical
Reporter: Alex Zhuravlev Assignee: Alex Zhuravlev
Resolution: Fixed Votes: 0
Labels: LTS12

Issue Links:
Blocker
Related
is related to LU-13416 Data corruption during IOR testing wi... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

there is no point to update in-bh inode every call to osd_ldiskfs_write_record(), but
the following construction makes it so:

        dirty_inode = test_and_set_bit(LDISKFS_INODE_JOURNAL_DATA,
                                       &ei->i_flags);
....
        if (dirty_inode)
                osd_dirty_inode(inode, I_DIRTY_DATASYNC);

there are two consequences:
1) transaction can exceed declared credits as osd_declare_write() doesn't reserve inode for overwrite case (then current operation aborts with -ENOSPC and filesystem turns read-only)
2) overwrites copy inode into buffer cache impacting performance, should be especially visible with changelogs enabled, where every record causes at least two separate writes



 Comments   
Comment by Gerrit Updater [ 22/Dec/20 ]

Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41069
Subject: LU-14267 osd: do not update inode each write
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b72f6bb341277f6357549c13af9de6ef52b95b3a

Comment by Andreas Dilger [ 23/Dec/20 ]

This regression was introduced into master by commit v2_13_53-166-ga23aac2219 patch https://review.whamcloud.com/38281 "LU-13416 ldiskfs: don't corrupt data on journal replay" so the fix patch should be included into the 2.14.0 release.

Comment by Gerrit Updater [ 05/Jan/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41069/
Subject: LU-14267 osd: do not update inode each write
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 620152339fe18f3a3cc317ab05a7e34adcc68098

Comment by Peter Jones [ 05/Jan/21 ]

Landed for 2.14

Comment by Gerrit Updater [ 08/Jan/21 ]

Etienne AUJAMES (eaujames@ddn.com) uploaded a new patch: https://review.whamcloud.com/41174
Subject: LU-14267 osd: do not update inode each write
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 034b328cf68ad1878c17ea798764a06020e003ea

Comment by Etienne Aujames [ 08/Jan/21 ]

The backport above fixes the https://review.whamcloud.com/38705/ on the b2_12 branch.

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