History

SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion")

Reverting commit d03727b248d0 "NFSv4 fix CLOSE not waiting for direct IO compeletion". This patch made it so that fput() by calling inode_dio_done() in nfs_file_release() would wait uninterruptably for any outstanding directIO to the file (but that wait on IO should be killable). The problem the patch was also trying to address was REMOVE returning ERR_ACCESS because the file is still opened, is supposed to be resolved by server returning ERR_FILE_OPEN and not ERR_ACCESS.

Olga Kornievskaia committed 6 years ago

Commit 65caafd1 parent 91228842 files · +4 −10Browse files

Unified · Split

2 files
  1. fs/nfs/direct.c +4 −9
  2. fs/nfs/file.c +0 −1
fs/nfs/direct.c+4−9
@@ -267,6 +267,8 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq) · 266 unmodified lines
267267 {
268268 struct inode *inode = dreq->inode;
269269
270+ inode_dio_end(inode);
271+
270272 if (dreq->iocb) {
271273 long res = (long) dreq->error;
272274 if (dreq->count != 0) {
@@ -278,10 +280,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq) · 5 unmodified lines
278280
279281 complete(&dreq->completion);
280282
281− igrab(inode);
282283 nfs_direct_req_release(dreq);
283− inode_dio_end(inode);
284− iput(inode);
285284 }
286285
287286 static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
@@ -411,10 +410,8 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq, · 123 unmodified lines
411410 * generic layer handle the completion.
412411 */
413412 if (requested_bytes == 0) {
414− igrab(inode);
415− nfs_direct_req_release(dreq);
416413 inode_dio_end(inode);
417− iput(inode);
414+ nfs_direct_req_release(dreq);
418415 return result < 0 ? result : -EIO;
419416 }
420417
@@ -867,10 +864,8 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, · 446 unmodified lines
867864 * generic layer handle the completion.
868865 */
869866 if (requested_bytes == 0) {
870− igrab(inode);
871− nfs_direct_req_release(dreq);
872867 inode_dio_end(inode);
873− iput(inode);
868+ nfs_direct_req_release(dreq);
874869 return result < 0 ? result : -EIO;
875870 }
876871
fs/nfs/file.c+0−1
@@ -83,7 +83,6 @@ nfs_file_release(struct inode *inode, struct file *filp) · 82 unmodified lines
8383 dprintk("NFS: release(%pD2)\n", filp);
8484
8585 nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
86− inode_dio_wait(inode);
8786 nfs_file_clear_open_context(filp);
8887 return 0;
8988 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t