If llapi_create_volatile_idx() is passed an MDT index other than
-1, it always uses 0 as the MDT index rather than the one provided.
This patch removes the use of LUSTRE_VOLATILE_IDX and uses
LUSTRE_VOLATILE_HDR with the MDT index instead, uses the provided
MDT index in the volatile file name and uses base 16 when reading
the MDT index from the file name using strtoul.
Signed-off-by: James Nunez <james.a.nunez@intel.com>
Signed-off-by: Bobbie Lind <bobbie.j.lind@intel.com>
Change-Id: I27e2beb8524683aba07c48297614dd02d7957af4
Reviewed-on: http://review.whamcloud.com/7613
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
*/
#define LUSTRE_VOLATILE_HDR ".\x0c\x13\x14\x12:VOLATILE"
#define LUSTRE_VOLATILE_HDR_LEN 14
-/* hdr + MDT index */
-#define LUSTRE_VOLATILE_IDX LUSTRE_VOLATILE_HDR":%.4X:"
typedef enum lustre_quota_version {
LUSTRE_QUOTA_V2 = 1
}
/* we have an idx, read it */
start = name + LUSTRE_VOLATILE_HDR_LEN + 1;
- *idx = strtoul(start, &end, 0);
+ *idx = strtoul(start, &end, 16);
/* error cases:
* no digit, no trailing :, negative value
*/
LUSTRE_VOLATILE_HDR"::%.4X", random);
else
snprintf(filename, sizeof(filename),
- LUSTRE_VOLATILE_IDX"%.4X", 0, random);
+ LUSTRE_VOLATILE_HDR":%.4X:%.4X", idx, random);
rc = snprintf(file_path, sizeof(file_path),
"%s/%s", directory, filename);