1.Add fid in md_revalidate_lock for locate mdt in
do_statahead_interpret.
2.locate right mdc for FID2PATH.
3.Only validating MDT0 connection for statfsi during Mount,
so even some MDTs are not avaible, the system can still be
setup.
Signed-off-by: Wang Di <di.wang@intel.com>
Change-Id: I40a3dcbe1f87cd38386ea360547dd2b4528645d1
Reviewed-on: http://review.whamcloud.com/4356
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
* interpret routine to be called.
* lov_statfs_fini() must thus be called
* by the request interpret routine */
* interpret routine to be called.
* lov_statfs_fini() must thus be called
* by the request interpret routine */
+#define OBD_STATFS_FOR_MDT0 0x0008 /* The statfs is only for retrieving
+ * information from MDT0. */
#define OBD_FL_PUNCH 0x00000001 /* To indicate it is punch operation */
/* OBD Device Declarations */
#define OBD_FL_PUNCH 0x00000001 /* To indicate it is punch operation */
/* OBD Device Declarations */
+ /* For mount, we only need fs info from MDT0, and also in DNE, it
+ * can make sure the client can be mounted as long as MDT0 is
+ * avaible */
err = obd_statfs(NULL, sbi->ll_md_exp, osfs,
err = obd_statfs(NULL, sbi->ll_md_exp, osfs,
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0);
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_FOR_MDT0);
if (err)
GOTO(out_md, err);
if (err)
GOTO(out_md, err);
- LASSERT(osfs->os_bsize);
+ LASSERT(osfs->os_bsize);
sb->s_blocksize = osfs->os_bsize;
sb->s_blocksize_bits = log2(osfs->os_bsize);
sb->s_magic = LL_SUPER_MAGIC;
sb->s_blocksize = osfs->os_bsize;
sb->s_blocksize_bits = log2(osfs->os_bsize);
sb->s_magic = LL_SUPER_MAGIC;
}
it->d.lustre.it_lock_handle = entry->se_handle;
}
it->d.lustre.it_lock_handle = entry->se_handle;
- rc = md_revalidate_lock(ll_i2mdexp(dir), it, NULL, NULL);
+ rc = md_revalidate_lock(ll_i2mdexp(dir), it, ll_inode2fid(dir), NULL);
if (rc != 1)
GOTO(out, rc = -EAGAIN);
if (rc != 1)
GOTO(out, rc = -EAGAIN);
const struct lu_fid *fid,
mdsno_t *mds)
{
const struct lu_fid *fid,
mdsno_t *mds)
{
- LASSERT(fid_is_sane(fid));
+ LASSERTF(fid_is_sane(fid), DFID" is insane!\n", PFID(fid));
/* FIXME: Because ZFS still use LOCAL fid sequence for root,
* and root will always be in MDT0, for local fid, it will
/* FIXME: Because ZFS still use LOCAL fid sequence for root,
* and root will always be in MDT0, for local fid, it will
rc = obd_iocontrol(cmd, lmv->tgts[0].ltd_exp, len, karg, uarg);
break;
}
rc = obd_iocontrol(cmd, lmv->tgts[0].ltd_exp, len, karg, uarg);
break;
}
+ case OBD_IOC_FID2PATH: {
+ struct getinfo_fid2path *gf;
+ struct lmv_tgt_desc *tgt;
+ gf = (struct getinfo_fid2path *)karg;
+ tgt = lmv_find_target(lmv, &gf->gf_fid);
+ if (IS_ERR(tgt))
+ RETURN(PTR_ERR(tgt));
+ rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
+ break;
+ }
default : {
for (i = 0; i < count; i++) {
int err;
default : {
for (i = 0; i < count; i++) {
int err;
rc);
GOTO(out_free_temp, rc);
}
rc);
GOTO(out_free_temp, rc);
}
- if (i == 0) {
- *osfs = *temp;
+
+ if (i == 0) {
+ *osfs = *temp;
+ /* If the statfs is from mount, it will needs
+ * retrieve necessary information from MDT0.
+ * i.e. mount does not need the merged osfs
+ * from all of MDT.
+ * And also clients can be mounted as long as
+ * MDT0 is in service*/
+ if (flags & OBD_STATFS_FOR_MDT0)
+ GOTO(out_free_temp, rc);
} else {
osfs->os_bavail += temp->os_bavail;
osfs->os_blocks += temp->os_blocks;
} else {
osfs->os_bavail += temp->os_bavail;
osfs->os_blocks += temp->os_blocks;