When obdfilter-survey first creates an object on a fresh ZFS OST, the
last ID object for FID_SEQ_ECHO has to be created in the first place.
The last ID FID, [FID_SEQ_ECHO:0:0], can not be converted to an OST ID
because the resulting OST ID would be indistinguishable from an
FID_SEQ_OST_MDT0 OST ID and would confuse ostid_id(). This patch
checks for last ID FIDs before converting them to OST IDs in
osd_get_idx_for_ost_obj().
Change-Id: I96cdf85b4725e4882cecabaf90466c7f77a5e0a6
Intel-bug-id: FF-182
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/8301
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
{
struct osd_seq *osd_seq;
unsigned long b;
{
struct osd_seq *osd_seq;
unsigned long b;
int rc;
osd_seq = osd_find_or_add_seq(env, osd, fid_seq(fid));
int rc;
osd_seq = osd_find_or_add_seq(env, osd, fid_seq(fid));
return PTR_ERR(osd_seq);
}
return PTR_ERR(osd_seq);
}
- rc = fid_to_ostid(fid, &osd_oti_get(env)->oti_ostid);
- LASSERT(rc == 0); /* we should not get here with IGIF */
- b = ostid_id(&osd_oti_get(env)->oti_ostid) % OSD_OST_MAP_SIZE;
+ if (fid_is_last_id(fid)) {
+ id = 0;
+ } else {
+ rc = fid_to_ostid(fid, &osd_oti_get(env)->oti_ostid);
+ LASSERT(rc == 0); /* we should not get here with IGIF */
+ id = ostid_id(&osd_oti_get(env)->oti_ostid);
+ }
+
+ b = id % OSD_OST_MAP_SIZE;
LASSERT(osd_seq->os_compat_dirs[b]);
LASSERT(osd_seq->os_compat_dirs[b]);
- sprintf(buf, LPU64, ostid_id(&osd_oti_get(env)->oti_ostid));
+ sprintf(buf, LPU64, id);
return osd_seq->os_compat_dirs[b];
}
return osd_seq->os_compat_dirs[b];
}