loff_t offset, __u64 ino, unsigned d_type);
static int osd_ios_dl_fill(void *buf, const char *name, int namelen,
loff_t offset, __u64 ino, unsigned d_type);
+static int osd_ios_uld_fill(void *buf, const char *name, int namelen,
+ loff_t offset, __u64 ino, unsigned d_type);
static int
osd_ios_general_scan(struct osd_thread_info *info, struct osd_device *dev,
OLF_HIDE_FID = 0x0002,
OLF_SHOW_NAME = 0x0004,
OLF_NO_OI = 0x0008,
+ OLF_IDX_IN_FID = 0x0010,
};
struct osd_lf_map {
{ "BATCHID", { FID_SEQ_LOCAL_FILE, BATCHID_COMMITTED_OID, 0 },
OLF_SHOW_NAME, sizeof("BATCHID") - 1, NULL, NULL },
+ /* OSP update logs update_log{_dir} use f_seq = FID_SEQ_UPDATE_LOG{_DIR}
+ * and f_oid = index for their log files. See lu_update_log{_dir}_fid()
+ * for more details. */
+
+ /* update_log */
+ { "update_log", { FID_SEQ_UPDATE_LOG, 0, 0 },
+ OLF_SHOW_NAME | OLF_IDX_IN_FID, sizeof("update_log") - 1,
+ NULL, NULL },
+
+ /* update_log_dir */
+ { "update_log_dir", { FID_SEQ_UPDATE_LOG_DIR, 0, 0 },
+ OLF_SHOW_NAME | OLF_SCAN_SUBITEMS | OLF_IDX_IN_FID,
+ sizeof("update_log_dir") - 1,
+ osd_ios_general_scan, osd_ios_uld_fill },
+
/* lost+found */
{ "lost+found", { FID_SEQ_LOCAL_FILE, OSD_LPF_OID, 0 },
OLF_SCAN_SUBITEMS, sizeof("lost+found") - 1,
osd_id_gen(id, inode->i_ino, inode->i_generation);
if (rc == -ENODATA) {
- if (fid == NULL || fid_is_zero(fid) || flags & OLF_HIDE_FID)
+ if (fid == NULL || fid_is_zero(fid) || flags & OLF_HIDE_FID) {
lu_igif_build(&tfid, inode->i_ino, inode->i_generation);
- else
+ } else {
tfid = *fid;
+ if (flags & OLF_IDX_IN_FID) {
+ LASSERT(dev->od_index >= 0);
+
+ tfid.f_oid = dev->od_index;
+ }
+ }
rc = osd_ea_fid_set(info, inode, &tfid, 0, 0);
if (rc != 0) {
CDEBUG(D_LFSCK, "%s: fail to set LMA for init OI "
RETURN(rc);
}
+static int osd_ios_uld_fill(void *buf, const char *name, int namelen,
+ loff_t offset, __u64 ino, unsigned d_type)
+{
+ struct osd_ios_filldir_buf *fill_buf = buf;
+ struct dentry *child;
+ struct lu_fid tfid;
+ int rc = 0;
+ ENTRY;
+
+ /* skip any non-DFID format name */
+ if (name[0] != '[')
+ RETURN(0);
+
+ child = osd_ios_lookup_one_len(name, fill_buf->oifb_dentry, namelen);
+ if (IS_ERR(child))
+ RETURN(PTR_ERR(child));
+
+ /* skip the start '[' */
+ sscanf(&name[1], SFID, RFID(&tfid));
+ if (fid_is_sane(&tfid))
+ rc = osd_ios_scan_one(fill_buf->oifb_info, fill_buf->oifb_dev,
+ child->d_inode, &tfid, 0);
+ else
+ rc = -EIO;
+ dput(child);
+
+ RETURN(rc);
+}
+
static int osd_ios_root_fill(void *buf, const char *name, int namelen,
loff_t offset, __u64 ino, unsigned d_type)
{
set -e
ONLY=${ONLY:-"$*"}
-#Bug number for excepting test 6380
-ALWAYS_EXCEPT="$SANITY_SCRUB_EXCEPT 1b 1c 2 3 4a 4b 4c 5 6 7 8 9 10 15"
+#Bug number for excepting test 6705
+ALWAYS_EXCEPT="$SANITY_SCRUB_EXCEPT 1c 5 10"
[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
scrub_prep 1000
scrub_backup_restore 1
- echo "starting MDTs with OI scrub disabled"
+ echo "starting MDTs with OI scrub disabled (1)"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 3 init
scrub_check_flags 4 inconsistent
do_nodes $(comma_list $(mdts_nodes)) \
$LCTL set_param fail_loc=0 fail_val=0
- echo "starting MDTs with OI scrub disabled"
+ echo "starting MDTs with OI scrub disabled (2)"
scrub_start_mds 10 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 11 crashed
scrub_stop_mds 12
test_10a() {
scrub_prep 0
scrub_backup_restore 1
- echo "starting mds$n with OI scrub disabled"
+ echo "starting mds$n with OI scrub disabled (1)"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
scrub_check_flags 4 inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_check_status 7 scanning
umount_client $MOUNT || error "(8) Fail to stop client!"
scrub_stop_mds 9
- echo "starting MDTs with OI scrub disabled"
+ echo "starting MDTs with OI scrub disabled (2)"
scrub_start_mds 10 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 11 paused
scrub_stop_mds 12