Bug 784019

Summary: Missing aio_complete() in finished_one_bio @ /fs/direct-io.c
Product: Red Hat Enterprise Linux 5 Reporter: Jan Kratochvíl <jan.kratochvil>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED DUPLICATE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7CC: studeny
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 745640 Environment:
Last Closed: 2013-02-15 13:04:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jan Kratochvíl 2012-01-23 15:17:05 UTC
+++ This bug was initially created as a clone of Bug #745640 +++

Description of problem:

Missing aio_complete() call in finished_one_bio @ /fs/direct-io.c can cause process hang on IO operation.

Version-Release number of selected component (if applicable):

Affected kernel is >= 5.6. Issue was not reproduced on RHEL 5.5 and lower kernel.

How reproducible:

Need to setup OCFS2 cluster FS and use Oracle's database DataPump to export file to OCFS2 partition(mount point).

Steps to Reproduce:
1.
2.
3.
  
Actual results:
Process hang / spin. Can't be killed - only OS restart.

Expected results:
Successfull information

Additional info:

From 2.6.18-274 RedHat patch :

diff -Naurp linux-2.6.18.4/fs/direct-io.c linux-2.6.18-redhat/fs/direct-io.c
--- linux-2.6.18.4/fs/direct-io.c
+++ linux-2.6.18-redhat/fs/direct-io.c

..
.. wrong :
..

+	if (dio->end_io && dio->result) {
+		if (dio->inode->i_sb->s_type->fs_flags & FS_HAS_IODONE2) {
+			dio_iodone2_t *end_io = (dio_iodone2_t *)dio->end_io;
+
+			end_io(dio->iocb, offset, transferred,
+				    dio->map_bh.b_private, ret, is_async);
+		} else
+			dio->end_io(dio->iocb, offset, transferred,
+				    dio->map_bh.b_private);
+	} else if (is_async) {
+		aio_complete(dio->iocb, ret, 0);
 	}

..
.. correct :
..

+	if (dio->end_io && dio->result) {
+		if (dio->inode->i_sb->s_type->fs_flags & FS_HAS_IODONE2) {
+			dio_iodone2_t *end_io = (dio_iodone2_t *)dio->end_io;
+
+			end_io(dio->iocb, offset, transferred,
+				    dio->map_bh.b_private, ret, is_async);
+		} else {
+			dio->end_io(dio->iocb, offset, transferred,
+				    dio->map_bh.b_private);
+			if (is_async)
+				aio_complete(dio->iocb, ret, 0);
+               }
+	} else if (is_async) {
+		aio_complete(dio->iocb, ret, 0);
 	}

Comment 1 Jes Sorensen 2013-02-15 13:04:54 UTC

*** This bug has been marked as a duplicate of bug 734157 ***