lustre_loa_swab(loa, true);
/* Check LMA compatibility */
if (lma->lma_incompat & ~LMA_INCOMPAT_SUPP) {
- CWARN("%s: unsupported incompat LMA feature(s) %#x "
- "for fid = "DFID", ino = %lu\n",
+ rc = -EOPNOTSUPP;
+ CWARN("%s: unsupported incompat LMA feature(s) %#x for fid = "DFID", ino = %lu: rc = %d\n",
osd_ino2name(inode),
lma->lma_incompat & ~LMA_INCOMPAT_SUPP,
- PFID(&lma->lma_self_fid), inode->i_ino);
- rc = -EOPNOTSUPP;
+ PFID(&lma->lma_self_fid), inode->i_ino, rc);
}
} else if (rc == 0) {
rc = -ENODATA;
iput(inode);
inode = ERR_PTR(-ESTALE);
} else if (is_bad_inode(inode)) {
- CWARN("%s: bad inode: ino = %u\n",
- osd_dev2name(dev), id->oii_ino);
+ rc = -ENOENT;
+ CWARN("%s: bad inode: ino = %u: rc = %d\n",
+ osd_dev2name(dev), id->oii_ino, rc);
iput(inode);
- inode = ERR_PTR(-ENOENT);
+ inode = ERR_PTR(rc);
} else if ((rc = osd_attach_jinode(inode))) {
iput(inode);
inode = ERR_PTR(rc);
out:
if (rc < 0)
- CDEBUG(D_LFSCK, "%s: fail to check LMV EA, inode = %lu/%u,"
- DFID": rc = %d\n", osd_ino2name(inode),
- inode->i_ino, inode->i_generation,
+ CDEBUG(D_LFSCK,
+ "%s: cannot check LMV, ino = %lu/%u "DFID": rc = %d\n",
+ osd_ino2name(inode), inode->i_ino, inode->i_generation,
PFID(&oic->oic_fid), rc);
else
rc = 0;
th->th_dev = d;
th->th_result = 0;
oh->ot_credits = 0;
+ oh->oh_declared_ext = 0;
INIT_LIST_HEAD(&oh->ot_commit_dcb_list);
INIT_LIST_HEAD(&oh->ot_stop_dcb_list);
INIT_LIST_HEAD(&oh->ot_trunc_locks);
bool ignore_edquot = !(attr->la_flags & LUSTRE_SET_SYNC_FL);
if (!ignore_edquot)
- CDEBUG(D_QUOTA, "%s: enforce quota on UID %u, GID %u"
- "(the quota space is %lld)\n",
- obj->oo_inode->i_sb->s_id, attr->la_uid,
+ CDEBUG(D_QUOTA,
+ "%s: enforce quota on UID %u, GID %u (quota space is %lld)\n",
+ osd_ino2name(obj->oo_inode), attr->la_uid,
attr->la_gid, bspace);
/* USERQUOTA */
rc = dquot_transfer(inode, &iattr);
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is quota "
- "enforcement enabled on the ldiskfs "
- "filesystem?\n", inode->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed. Is quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(inode), rc);
return rc;
}
}
rc = -ENOTSUPP;
#endif
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is project "
- "enforcement enabled on the ldiskfs "
- "filesystem?\n", inode->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed. Is project enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(inode), rc);
return rc;
}
}
LASSERT(obj->oo_inode != NULL);
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSD_OI_ENOSPC))
+ return -ENOSPC;
+
oh = container_of(th, struct osd_thandle, ot_super);
LASSERT(oh->ot_handle);
osd_trans_exec_op(env, th, OSD_OT_INSERT);
__u32 saved_nlink = dir->i_nlink;
int rc;
+ if (OBD_FAIL_CHECK(OBD_FAIL_OSD_DOTDOT_ENOSPC))
+ return -ENOSPC;
+
dot_dot_ldp = (struct ldiskfs_dentry_param *)info->oti_ldp2;
osd_get_ldiskfs_dirent_param(dot_dot_ldp, dot_dot_fid);
i_projid_read(pobj->oo_inode) != 0) {
rc = osd_transfer_project(local, 0, th);
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is project "
- "quota enforcement enabled on the ldiskfs "
- "filesystem?\n", local->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed:. Is project quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(local), rc);
RETURN(ERR_PTR(rc));
}
}
obj->oo_dt.do_body_ops = &osd_body_ops;
}
- if (!result && !CFS_FAIL_CHECK(OBD_FAIL_OSD_NO_OI_ENTRY))
+ if (!result && !CFS_FAIL_CHECK(OBD_FAIL_OSD_NO_OI_ENTRY)) {
+ struct inode *inode = obj->oo_inode;
+
result = __osd_oi_insert(env, obj, fid, th);
+ if (result && inode) {
+ spin_lock(&obj->oo_guard);
+ clear_nlink(inode);
+ spin_unlock(&obj->oo_guard);
+ osd_dirty_inode(inode, I_DIRTY_DATASYNC);
+ ldiskfs_set_inode_state(inode,
+ LDISKFS_STATE_LUSTRE_DESTROY);
+ iput(inode);
+ obj->oo_inode = NULL;
+ }
+ }
/*
* a small optimization - dt_insert() isn't usually applied
rc = osd_scrub_start(oti->oti_env, dev, SS_AUTO_PARTIAL |
SS_CLEAR_DRYRUN | SS_CLEAR_FAILOUT);
CDEBUG(D_LFSCK | D_CONSOLE | D_WARNING,
- "%s: trigger partial OI scrub for RPC inconsistency "
- "checking FID "DFID": rc = %d\n",
+ "%s: trigger partial OI scrub for RPC inconsistency checking FID "DFID": rc = %d\n",
osd_dev2name(dev), PFID(fid), rc);
if (rc == 0 || rc == -EALREADY)
goto again;
* That means we lose it!
*/
if (rc != 0)
- CDEBUG(D_LFSCK, "%s: fail to reinsert the dirent, "
- "dir = %lu/%u, name = %.*s, "DFID": rc = %d\n",
- osd_ino2name(inode),
- dir->i_ino, dir->i_generation, namelen,
- dentry->d_name.name, PFID(fid), rc);
+ CDEBUG(D_LFSCK,
+ "%s: fail to reinsert the dirent, dir = %lu/%u, name = %.*s, "DFID": rc = %d\n",
+ osd_ino2name(inode), dir->i_ino, dir->i_generation,
+ namelen, dentry->d_name.name, PFID(fid), rc);
RETURN(rc);
}
osd_procfs_fini(o);
if (o->od_oi_table != NULL)
osd_oi_fini(osd_oti_get(env), o);
+ if (o->od_extent_bytes_percpu)
+ free_percpu(o->od_extent_bytes_percpu);
osd_obj_map_fini(o);
osd_umount(env, o);
o->od_readcache_max_iosize = OSD_READCACHE_MAX_IO_MB << 20;
o->od_writethrough_max_iosize = OSD_WRITECACHE_MAX_IO_MB << 20;
o->od_auto_scrub_interval = AS_DEFAULT;
+ /* default fallocate to unwritten extents: LU-14326/LU-14333 */
+ o->od_fallocate_zero_blocks = 0;
cplen = strlcpy(o->od_svname, lustre_cfg_string(cfg, 4),
sizeof(o->od_svname));
GOTO(out_procfs, rc);
}
+ o->od_extent_bytes_percpu = alloc_percpu(unsigned int);
+ if (!o->od_extent_bytes_percpu) {
+ rc = -ENOMEM;
+ GOTO(out_procfs, rc);
+ }
+
RETURN(0);
out_procfs: