[LU-8025] ll_direct_io code introduced in LU-6260 is based on 2.4/2.5, ignores LU-1669 Created: 14/Apr/16  Updated: 23/Feb/17  Resolved: 02/Sep/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.7.0, Lustre 2.8.0
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Major
Reporter: Patrick Farrell (Inactive) Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File inode_lock.log    
Issue Links:
Related
is related to LU-1669 lli->lli_write_mutex (single shared f... Resolved
is related to LU-6215 Sync Lustre external tree with lustre... Resolved
is related to LU-8162 Get i_mutex lock when changing SUID bits Resolved
is related to LU-8656 IS_NOSEC check in vvp_io_write_start ... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The patch for ll_direct_(io/IO_26) we got from Al Viro is based on the 2.4-2.5 code, and reverts several of the changes made by LU-1669 to the direct IO path. It seems we took his version without noting that important changes had been made in that function.

The i_mutex, for example, no longer provides the expected protection.

Thankfully for older kernels we left the updated code alone, but the code we call for 3.16 kernels is definitely wrong and needs to be updated to match current Lustre. It seems we need to take more care when forward/side-porting from the upstream kernels.

Unfortunately, I won't be able to provide a patch for this. If correct direct IO behavior on 3.16 and newer kernels is important to someone, fixing it shouldn't be too hard - Just look at the code that follows:

#else /* !HAVE_DIRECTIO_ITER && !HAVE_IOV_ITER_RW */

in lustre/llite/rw26.c, and re-write the code above it to have the same approach to locking. Looking at the LU-6260 patch may help:
http://review.whamcloud.com/#/c/14665/9



 Comments   
Comment by Gerrit Updater [ 28/Apr/16 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: http://review.whamcloud.com/19840
Subject: LU-8025 llite: make vvp_io_write_start lockless for newer kernels
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1ac869430759817b29c2d6ac4b4939e369fc3e44

Comment by James A Simmons [ 23/Aug/16 ]

dmesg output from the failed RHEL7 sanityn 77a run.

Comment by Gerrit Updater [ 02/Sep/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/19840/
Subject: LU-8025 llite: make vvp_io_write_start lockless for newer kernels
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f38911bc6a0e472e43b901bcb8ab74fc36c4e1e1

Comment by Peter Jones [ 02/Sep/16 ]

Landed for 2.9

Generated at Sat Feb 10 02:13:58 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.