Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aufs: bugfix, AIO keeps h_file in kiocb
AIO implementation in aufs has never been correct I'm afraid. The code was written in aufs2.6 era and the local test has ever passed, but it might be just a luck. - AIO splits an I/O into two parts, 'submit' and 'complete'. Often they are called 'top-half' and 'bottom-half'. They run independently. - aufs modifies a kernel internal data temporary in top-half. - and aufs restores the modified data, also in top-half phase. This is the bug. Such restoration should be done AFTER bottom-half completed. The bug is a race condition I'm afraid. If bottom-half routine accesses the "temporary modifed but already restored" internal data, it would get crazy (and Bang!). But if bottom-half starts and completes so quicky that BEFORE the restoration, no problem would happen. The problem is uncovered due to direct-io. Generally direct-io is slow. And its slowness is the key here. Probaly it is formal/polite/well-mannered for aufs to register a new hidden I/O requests for the branch fs in top-half. But it is a little bit too gorgeous approach. I'd try another way which is simply stops the restoration. This is rather violent since kernel doesn't expect its data to be modified silently. See-also: sfjro/aufs-standalone#39 Signed-off-by: J. R. Okajima <[email protected]>
- Loading branch information