+ /* Sort the updates in ascending order */
+ list_for_each_entry_safe_reverse(tmp, n, list, qur_link) {
+
+ /* There could be some legacy records which have duplicated
+ * version. Imagine following scenario: slave received global
+ * glimpse and queued a record in the deferred list, then
+ * master crash and rollback to an ealier version, then the
+ * version of queued record will be conflicting with later
+ * updates. We should just delete the legacy record in such
+ * case. */
+ if (upd->qur_ver == tmp->qur_ver) {
+ LASSERT(tmp->qur_lqe);
+ LQUOTA_ERROR(tmp->qur_lqe, "Found a conflict record "
+ "with ver:"LPU64"", tmp->qur_ver);
+ list_del_init(&tmp->qur_link);
+ qsd_upd_free(tmp);
+ } else if (upd->qur_ver < tmp->qur_ver) {