}
id = &info->oti_id;
+ memset(id, 0, sizeof(struct osd_inode_id));
if (!list_empty(&scrub->os_inconsistent_items)) {
/* Search order: 2. OI scrub pending list. */
result = osd_oii_lookup(dev, fid, id);
goto found;
}
- if (dev->od_auto_scrub_interval == AS_NEVER) {
+ if (dev->od_scrub.os_scrub.os_auto_scrub_interval == AS_NEVER) {
if (!remote)
GOTO(out, result = -EREMCHG);
dquot_initialize(inode);
transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
if (transfer_to[PRJQUOTA]) {
+ lock_dquot_transfer(inode);
err = __dquot_transfer(inode, transfer_to);
+ unlock_dquot_transfer(inode);
dqput(transfer_to[PRJQUOTA]);
if (err)
return err;
iattr.ia_uid = make_kuid(&init_user_ns, attr->la_uid);
iattr.ia_gid = make_kgid(&init_user_ns, attr->la_gid);
+ lock_dquot_transfer(inode);
rc = dquot_transfer(inode, &iattr);
+ unlock_dquot_transfer(inode);
if (rc) {
CERROR("%s: quota transfer failed. Is quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
osd_ino2name(inode), rc);
}
static int
-osd_consistency_check(struct osd_thread_info *oti, struct osd_device *dev,
- const struct lu_fid *fid, struct osd_inode_id *id)
+osd_ldiskfs_consistency_check(struct osd_thread_info *oti,
+ struct osd_device *dev,
+ const struct lu_fid *fid,
+ struct osd_inode_id *id)
{
struct lustre_scrub *scrub = &dev->od_scrub.os_scrub;
struct inode *inode = NULL;
int rc;
ENTRY;
-
- if (!fid_is_norm(fid) && !fid_is_igif(fid))
- RETURN(0);
-
- if (scrub->os_running && scrub->os_pos_current > id->oii_ino)
+ if (!scrub_needs_check(scrub, fid, id->oii_ino))
RETURN(0);
-
- if (dev->od_auto_scrub_interval == AS_NEVER ||
- ktime_get_real_seconds() <
- scrub->os_file.sf_time_last_complete + dev->od_auto_scrub_interval)
- RETURN(0);
-
again:
rc = osd_oi_lookup(oti, dev, fid, &oti->oti_id, 0);
if (rc == -ENOENT) {
GOTO(out, rc);
}
- if (dev->od_auto_scrub_interval != AS_NEVER && ++once == 1) {
+ if (dev->od_scrub.os_scrub.os_auto_scrub_interval != AS_NEVER &&
+ ++once == 1) {
rc = osd_scrub_start(oti->oti_env, dev, SS_AUTO_PARTIAL |
SS_CLEAR_DRYRUN | SS_CLEAR_FAILOUT);
CDEBUG_LIMIT(D_LFSCK | D_CONSOLE | D_WARNING,
if (rc != 0 || osd_remote_fid(env, dev, fid))
GOTO(out, rc);
- rc = osd_consistency_check(oti, dev, fid, id);
+ rc = osd_ldiskfs_consistency_check(oti, dev, fid, id);
if (rc != -ENOENT) {
/* Other error should not affect lookup result. */
rc = 0;
if (unlikely(!ldiskfs_has_feature_largedir(o->od_mnt->mnt_sb) &&
!strstr(name, "MGS"))) {
ldiskfs_set_feature_largedir(o->od_mnt->mnt_sb);
- LCONSOLE_INFO("%s: enable 'large_dir' feature on device '%s'\n",
+ LCONSOLE_INFO("%s: enabled 'large_dir' feature on device %s\n",
name, dev);
}
#endif
}
if (lmd_flags & LMD_FLG_NOSCRUB)
- o->od_auto_scrub_interval = AS_NEVER;
+ o->od_scrub.os_scrub.os_auto_scrub_interval = AS_NEVER;
if (blk_queue_nonrot(bdev_get_queue(osd_sb(o)->s_bdev))) {
/* do not use pagecache with flash-backed storage */
o->od_readcache_max_filesize = OSD_MAX_CACHE_SIZE;
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;
+ o->od_scrub.os_scrub.os_auto_scrub_interval = AS_DEFAULT;
/* default fallocate to unwritten extents: LU-14326/LU-14333 */
o->od_fallocate_zero_blocks = 0;