Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5978

Remove migration of old admin quota files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • Lustre 2.8.0
    • Lustre 2.8.0
    • 3
    • 16691

    Description

      Lustre 2.4 added migration of old admin quota files in Linux quota file v2 format into the new quota global indexes in IAM format. Lustre 2.8, tag 2.7.53 and above, no longer maintains this migration. If we do not want to continue with migration of old admin quota files, then the following code can be removed. If we want to continue with the migration, we need to modify the following code.

      In file lustre/osd-ldiskfs/osd_quota.c, the following routines will no longer defined:

      #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
      /* Following code is used to migrate old admin quota files (in Linux quota
       * file v2 format) into the new quota global indexes (in IAM format). */
      
      /* copied from osd_it_acct_get(), only changed the 'type' to -1 */
      static int osd_it_admin_get(const struct lu_env *env, struct dt_it *di,
      			    const struct dt_key *key)
      {
      …
      }
      
      static int osd_it_admin_load(const struct lu_env *env,
      			     const struct dt_it *di, __u64 hash)
      {
      	int rc;
      	ENTRY;
      
      	rc = osd_it_admin_get(env, (struct dt_it *)di,
      			      (const struct dt_key *)&hash);
      	RETURN(rc);
      }
      
      static int osd_it_admin_rec(const struct lu_env *env,
      			    const struct dt_it *di,
      			    struct dt_rec *dtrec, __u32 attr)
      {
      …
      }
      
      /* copied from osd_it_acct_next(), only changed the 'type' to -1 */
      static int osd_it_admin_next(const struct lu_env *env, struct dt_it *di)
      {
      …
      }
      
      const struct dt_index_operations osd_admin_index_ops = {
      …
      };
      
      static int convert_quota_file(const struct lu_env *env,
      			      struct dt_object *old, struct dt_object *new,
      			      bool isblk)
      {
      …
      }
      
      /* Nobdy else can access the global index now, it's safe to truncate and
       * reinitialize it */
      static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt,
      				const struct dt_index_features *feat)
      {
      …
      }
      
      static int set_quota_index_version(const struct lu_env *env,
      				   struct dt_object *dt,
      				   dt_obj_version_t version)
      {
      …
      }
      
      int osd_quota_migration(const struct lu_env *env, struct dt_object *dt,
      			const struct dt_index_features *feat)
      {
      …
      }
      #endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) */
      

      Also, in file lustre/osd-ldiskfs/osd_quota_fmt.c, quota_read_blk():

      #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
      	/* type is set as -1 when reading old admin quota file */
      	if (type != USRQUOTA && type != GRPQUOTA) {
      		struct lu_buf	lu_buffer;
      		loff_t		pos;
      
      		lu_buffer.lb_buf = buf;
      		lu_buffer.lb_len = LUSTRE_DQBLKSIZE;
      		pos = blk << LUSTRE_DQBLKSIZE_BITS;
      
      		ret = dt_record_read(env, &obj->oo_dt, &lu_buffer, &pos);
      
      		if (ret == 0)
      			ret = LUSTRE_DQBLKSIZE;
      		else if (ret == -EBADR || ret == -EFAULT)
      			ret = 0;
      		RETURN(ret);
      	}
      #else
      #warning "remove old quota compatibility code"
      #endif
      

      Attachments

        Issue Links

          Activity

            People

              niu Niu Yawei (Inactive)
              jamesanunez James Nunez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: