- **status**: review --> fixed
- **Milestone**: 4.7-Tentative --> 4.5.2
- **Comment**:
changeset: 6599:512659e50b5c
branch: opensaf-4.5.x
parent: 6593:49e69afbd0df
user: A V Mahesh <[email protected]>
date: Thu Jun 04 14:18:37 2015 +0530
summary: leap: enhance posix_shm() to accommodate SaOffsetT [#1271]
changeset: 6601:d7368041f931
branch: opensaf-4.6.x
parent: 6594:447615c80905
user: A V Mahesh <[email protected]>
date: Thu Jun 04 14:23:22 2015 +0530
summary: leap: enhance posix_shm() to accommodate SaOffsetT [#1271]
changeset: 6603:5133a0a441a6
parent: 6598:ca169b780407
user: A V Mahesh <[email protected]>
date: Thu Jun 04 14:24:05 2015 +0530
summary: leap: enhance posix_shm() to accommodate SaOffsetT [#1271]
---
** [tickets:#1271] leap : align attr of leap ncs_os_posix_shm() to uint64_t**
**Status:** fixed
**Milestone:** 4.5.2
**Created:** Thu Mar 19, 2015 03:53 AM UTC by A V Mahesh (AVM)
**Last Updated:** Fri May 15, 2015 08:44 AM UTC
**Owner:** Ramesh
Their is a limitation in Leap ncs_os_posix_shm() function
As the "maxSectionSize" defined in CKPT is of "SaUint64T" type and the "offset"
which
is been derived from "+maxSectionSize" should also align to "uint64_t" type.
>> The memory allocation for the checkpoint:
>>
>>
>>
>> CKPT_HEADER + MAXSECTION*(SECTIONSIZE + SECTIONHEADER)
>>
>>
>>
>> |---------------|------------ |--------------
>> |------------|-------------|--- -------|-------------|-------------|
>>
>> | CKPT_HDR | SEC_HDR | SEC_INFO |SEC_HDR | SEC_INFO |.............|
>> SEC_HDR |SEC_INFO |
>>
>> |---------------|------------ |--------------
>> |------------|-------------|--- -------|-------------|-------------|
>>
>>
>>
>> The checkpoint section is read base on checkpoint pointer. For example: we
>> need to read data from checkpoint section 5000.
>>
>>
>>
>> Then it will get checkpoint + checkpoint section offset. The checkpoint
>> section offset in this case is 4999*(SECTIONSIZE + SECTIONHEADER). If the
>> section size is 2MB, is it overflow?
>>
>>
>>
>> i_offset datatype is int32_t.
>>
>>
>>
>> while (counter < ckpt_hdr.n_secs) {
>>
>> memset(&read_req, '\0',
>> sizeof(NCS_OS_POSIX_SHM_REQ_INFO));
>>
>> memset(§_hdr, '\0',
>> sizeof(CPSV_SECT_HDR));
>>
>> read_req.type =
>> NCS_OS_POSIX_SHM_REQ_READ;
>>
>> read_req.info.read.i_addr =
>> (void *)((char *)open_req->info.open.o_addr + sizeof(CPSV_CKPT_HDR));
>>
>> read_req.info.read.i_read_size =
>> sizeof(CPSV_SECT_HDR);
>>
>> read_req.info.read.i_offset =
>>
>> counter *
>> (sizeof(CPSV_SECT_HDR) + (*cp_node)->create_attrib.maxSectionSize);
>>
>> read_req.info.read.i_to_buff =
>> (CPSV_SECT_HDR *)§_hdr;
>>
>> rc = ncs_os_posix_shm(&read_req);
>>
>> if (rc != NCSCC_RC_SUCCESS) {
>>
>>
>> LOG_ER("cpnd sect HDR read failed");
>>
>> /*
>> assert(0); */
>>
>> return rc;
>>
>> }
>>
>> …
>>
>> }
>>
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.------------------------------------------------------------------------------
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets