[LU-13900] don't call aio_complete() in lustre upon errors Created: 11/Aug/20  Updated: 06/Mar/21  Resolved: 19/Sep/20

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

Type: Bug Priority: Major
Reporter: Wang Shilong (Inactive) Assignee: Wang Shilong (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-4198 Improve IO performance when using DIR... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

See following codes in aio_ret():

    static inline ssize_t aio_ret(struct kiocb *req, ssize_t ret)
    {
            switch (ret) {
            case -EIOCBQUEUED:
                    return ret;
            case -ERESTARTSYS:
            case -ERESTARTNOINTR:
            case -ERESTARTNOHAND:
            case -ERESTART_RESTARTBLOCK:
                    /*
                     * There's no easy way to restart the
                     * syscall since other AIO's may be already running.
                     * Just fail this IO with EINTR.
                     */
                    ret = -EINTR;
                    /*FALLTHRU*/
            default:
                    aio_complete(req, ret, 0);
                    return 0;
            }
    }
   

VFS will call aio_complete() if ret is not -EIOCBQUEUED,
this could happen when we don't pass user buffer as page
alignment or some other errors happen in Lustre.

So in Lustre, we need be careful to handle this case to avoid double
aio_complete() called.



 Comments   
Comment by Gerrit Updater [ 11/Aug/20 ]

Wang Shilong (wshilong@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39636
Subject: LU-13900 clio: don't call aio_complete() in lustre upon errors
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fc48392af2a55db944e8bc3411d5975db0bb5886

Comment by Gerrit Updater [ 19/Sep/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39636/
Subject: LU-13900 clio: don't call aio_complete() in lustre upon errors
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2fb8444b5a636956281f180a04845502e7e99691

Comment by Peter Jones [ 19/Sep/20 ]

Landed for 2.14

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