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

Commit 212f6c7f authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lmv: fix some byte order issues



In the handler for LL_IOC_LMV_GETSTRIPE convert stripe FIDs from
little to CPU endian when unpacking lmv_user_md. In lmv_unpack_md_v1()
fix a double conversion of the stripe count.

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5342
Reviewed-on: http://review.whamcloud.com/11106


Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJian Yu <jian.yu@intel.com>
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 47137ad3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1252,16 +1252,16 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		tmp->lum_stripe_count = 0;
		tmp->lum_stripe_offset = mdt_index;
		for (i = 0; i < stripe_count; i++) {
			struct lu_fid   *fid;
			struct lu_fid fid;

			fid = &lmm->lmv_md_v1.lmv_stripe_fids[i];
			mdt_index = ll_get_mdt_idx_by_fid(sbi, fid);
			fid_le_to_cpu(&fid, &lmm->lmv_md_v1.lmv_stripe_fids[i]);
			mdt_index = ll_get_mdt_idx_by_fid(sbi, &fid);
			if (mdt_index < 0) {
				rc = mdt_index;
				goto out_tmp;
			}
			tmp->lum_objects[i].lum_mds = mdt_index;
			tmp->lum_objects[i].lum_fid = *fid;
			tmp->lum_objects[i].lum_fid = fid;
			tmp->lum_stripe_count++;
		}

+1 −1
Original line number Diff line number Diff line
@@ -2907,7 +2907,7 @@ static int lmv_unpack_md_v1(struct obd_export *exp, struct lmv_stripe_md *lsm,
	       lsm->lsm_md_hash_type, lsm->lsm_md_layout_version);

	stripe_count = le32_to_cpu(lmm1->lmv_stripe_count);
	for (i = 0; i < le32_to_cpu(stripe_count); i++) {
	for (i = 0; i < stripe_count; i++) {
		fid_le_to_cpu(&lsm->lsm_md_oinfo[i].lmo_fid,
			      &lmm1->lmv_stripe_fids[i]);
		rc = lmv_fld_lookup(lmv, &lsm->lsm_md_oinfo[i].lmo_fid,