Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d62e09c authored by wang di's avatar wang di Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lmv: honor MDT index when creating volatile file



LMV should honor MDT index embedded in the name of volatile
file, then during hsm restore, the file under striped dir can
be restored to the right MDT.

Signed-off-by: default avatarwang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4691
Reviewed-on: http://review.whamcloud.com/10866


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarHenri Doreau <henri.doreau@cea.fr>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cde5f109
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ struct ost_id {
#define LL_IOC_HSM_IMPORT		_IOWR('f', 245, struct hsm_user_import)
#define LL_IOC_LMV_SET_DEFAULT_STRIPE	_IOWR('f', 246, struct lmv_user_md)
#define LL_IOC_MIGRATE			_IOR('f', 247, int)
#define LL_IOC_FID2MDTIDX		_IOWR('f', 248, struct lu_fid)

#define LL_STATFS_LMV	   1
#define LL_STATFS_LOV	   2
+17 −0
Original line number Diff line number Diff line
@@ -1568,6 +1568,23 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		return rc;
	case OBD_IOC_FID2PATH:
		return ll_fid2path(inode, (void __user *)arg);
	case LL_IOC_FID2MDTIDX: {
		struct obd_export *exp = ll_i2mdexp(inode);
		struct lu_fid fid;
		__u32 index;

		if (copy_from_user(&fid, (const struct lu_fid __user *)arg,
				   sizeof(fid)))
			return -EFAULT;

		/* Call mdc_iocontrol */
		rc = obd_iocontrol(LL_IOC_FID2MDTIDX, exp, sizeof(fid), &fid,
				   &index);
		if (rc)
			return rc;

		return index;
	}
	case LL_IOC_HSM_REQUEST: {
		struct hsm_user_request	*hur;
		ssize_t			 totalsize;
+3 −2
Original line number Diff line number Diff line
@@ -2373,8 +2373,9 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
	op_data->op_bias = 0;
	op_data->op_cli_flags = 0;
	if ((opc == LUSTRE_OPC_CREATE) && name &&
	    filename_is_volatile(name, namelen, NULL))
	    filename_is_volatile(name, namelen, &op_data->op_mds))
		op_data->op_bias |= MDS_CREATE_VOLATILE;
	else
		op_data->op_mds = 0;
	op_data->op_data = data;

+9 −7
Original line number Diff line number Diff line
@@ -47,18 +47,20 @@
#include "../include/lprocfs_status.h"
#include "lmv_internal.h"

int lmv_fld_lookup(struct lmv_obd *lmv,
		   const struct lu_fid *fid,
		   u32 *mds)
int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds)
{
	struct obd_device *obd = lmv2obd_dev(lmv);
	int rc;

	/* FIXME: Currently ZFS still use local seq for ROOT unfortunately, and
	/*
	 * FIXME: Currently ZFS still use local seq for ROOT unfortunately, and
	 * this fid_is_local check should be removed once LU-2240 is fixed
	 */
	LASSERTF((fid_seq_in_fldb(fid_seq(fid)) ||
		  fid_seq_is_local_file(fid_seq(fid))) &&
		 fid_is_sane(fid), DFID" is insane!\n", PFID(fid));
	if (!fid_is_sane(fid) || !(fid_seq_in_fldb(fid_seq(fid)) ||
				   fid_seq_is_local_file(fid_seq(fid)))) {
		CERROR("%s: invalid FID " DFID "\n", obd->obd_name, PFID(fid));
		return -EINVAL;
	}

	rc = fld_client_lookup(&lmv->lmv_fld, fid_seq(fid), mds,
			       LU_SEQ_RANGE_MDT, NULL);
+5 −0
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
			  ldlm_blocking_callback cb_blocking,
			  int extra_lock_flags);

static inline struct obd_device *lmv2obd_dev(struct lmv_obd *lmv)
{
	return container_of0(lmv, struct obd_device, u.lmv);
}

static inline struct lmv_tgt_desc *
lmv_get_target(struct lmv_obd *lmv, u32 mdt_idx, int *index)
{
Loading