+ if (sf->sf_flags & SF_INCONSISTENT)
+ verify = 1;
+ }
+
+ fid_zero(&oic->oic_fid);
+ /* Search order: 3. OI files. */
+ result = osd_oi_lookup(info, dev, fid, id);
+ if (result != 0 && result != -ENOENT)
+ GOTO(out, result);
+
+ /* If fid wasn't found in oi, inode-less object is created,
+ * for which lu_object_exists() returns false. This is used
+ * in a (frequent) case when objects are created as locking
+ * anchors or place holders for objects yet to be created. */
+ if (conf != NULL && conf->loc_flags & LOC_F_NEW) {
+ if (unlikely(result == 0))
+ GOTO(out, result = -EEXIST);
+ else
+ GOTO(out, result = 0);
+ }
+
+ if (result == -ENOENT) {
+ if (!fid_is_norm(fid) ||
+ !ldiskfs_test_bit(osd_oi_fid2idx(dev,fid),
+ sf->sf_oi_bitmap))
+ GOTO(out, result = 0);
+
+ goto trigger;
+ }
+
+iget:
+ if (verify == 0)
+ inode = osd_iget(info, dev, id);
+ else
+ inode = osd_iget_verify(info, dev, id, fid);
+ if (IS_ERR(inode)) {
+ result = PTR_ERR(inode);
+ if (result == -ENOENT || result == -ESTALE) {
+ result = 0;
+ } else if (result == -EREMCHG) {
+
+trigger:
+ if (thread_is_running(&scrub->os_thread)) {
+ result = -EINPROGRESS;
+ } else if (!scrub->os_no_scrub) {
+ result = osd_scrub_start(dev);
+ LCONSOLE_ERROR("Trigger OI scrub by RPC for "
+ DFID", rc = %d\n",
+ PFID(fid), result);
+ if (result == 0 || result == -EALREADY)
+ result = -EINPROGRESS;
+ else
+ result = -EREMCHG;
+ }
+ }