Whamcloud - gitweb
LU-13608 out: don't return einprogress error 38/39538/3
authorAlexander Boyko <c17825@cray.com>
Thu, 30 Jul 2020 12:04:27 +0000 (08:04 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Sep 2020 03:44:37 +0000 (03:44 +0000)
When out_handle proccess an update request it could happened
that file doesn't exist, osd_fid_lookup triggers  scrub and
returns EINPROGRESS. Remote MDT would process EINPROGRESS at
ptlrpc layer and resend a request in loop, and MDT recovery
would be blocked.

The fix adds fid to OI for ENOENT, like it was before the LU-7782.
So the second attempt with the same fid will return ENOENT.

Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
HPE-bug-id: LUS-9062
Change-Id: Ib9a1753234ccc773e9b9529195ebfa6e5a8c101c
Reviewed-on: https://review.whamcloud.com/39538
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 35b248b..3948b6d 100644 (file)
@@ -1183,13 +1183,15 @@ trigger:
                if (scrub->os_partial_scan && !scrub->os_in_join)
                        goto join;
 
-               if (IS_ERR_OR_NULL(inode) || result)
+               osd_add_oi_cache(info, dev, id, fid);
+               if (IS_ERR_OR_NULL(inode) || result) {
+                       osd_oii_insert(dev, oic, result == -ENOENT);
                        GOTO(out, result = -EINPROGRESS);
+               }
 
                LASSERT(remote);
                LASSERT(obj->oo_inode == inode);
 
-               osd_add_oi_cache(info, dev, id, fid);
                osd_oii_insert(dev, oic, true);
                goto found;
        }
@@ -1212,13 +1214,15 @@ join:
        if (rc1 && rc1 != -EALREADY)
                GOTO(out, result = -EREMCHG);
 
-       if (IS_ERR_OR_NULL(inode) || result)
+       osd_add_oi_cache(info, dev, id, fid);
+       if (IS_ERR_OR_NULL(inode) || result) {
+               osd_oii_insert(dev, oic, result == -ENOENT);
                GOTO(out, result = -EINPROGRESS);
+       }
 
        LASSERT(remote);
        LASSERT(obj->oo_inode == inode);
 
-       osd_add_oi_cache(info, dev, id, fid);
        osd_oii_insert(dev, oic, true);
        goto found;