Skip to contentSkip to conversation

mem/hugeshmget: fix failure of hugeshmget01

PATCH In review liubo 2 participants 2 messages Nov 17, 2009 – Nov 19, 2009

lore
Share & tools
lore

liubo

author
#0 lore raw

PATCH 1/1 mem/hugeshmget: fix failure of hugeshmget01

During hugeshmget01 testcase, we got the following:

hugeshmget01    1  TFAIL  :  seqment size is not correct
hugeshmget01    1  TFAIL  :  hugeshmget01 call failed - errno = 17 :
File exists
                ......

In shmget call,
"buf.shm_segsz" had been set to "huge_pages_shm_to_be_allocated", but the code still used old macro "HUGE_SHM_SIZE", and this leaded to error "seqment size is not correct".

So do the following change:
1) s/HUGE_SHM_SIZE/huge_pages_shm_to_be_allocated
2) Delete unused macro "HUGE_SHM_SIZE" defination

This patch fixed the failure.

---
 .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c   |    2 +-
 testcases/kernel/mem/hugetlb/lib/ipcshm.h          |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +1 -1
index 0486dc3..10f29d3 100644
@@ -109,7 +109,7 @@ int main(int ac, char **av)
 					continue;
 				}
 				/* check the seqment size */
-				if (buf.shm_segsz != HUGE_SHM_SIZE) {
+				if (buf.shm_segsz != huge_pages_shm_to_be_allocated) {
 					tst_resm(TFAIL, "seqment size is not "
 						 "correct");
 					continue;
testcases/kernel/mem/hugetlb/lib/ipcshm.h +0 -1
index 5b92530..caac9af 100644
@@ -42,7 +42,6 @@ void setup(void);
 #define SHM_HUGETLB   04000    /* segment is mapped via hugetlb */
 #endif
 
-#define HUGE_SHM_SIZE	(256UL*1024UL*1024UL)	/* a resonable size for a large page segment */
 
 #define MODE_MASK	0x01FF			/* to get the lower nine permission bits */
 						/* from shmid_ds.ipc_perm.mode		 */
Signature · 11 lines
1.6.2.2

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 11 lines · liubo

During hugeshmget01 testcase, we got the following:

hugeshmget01    1  TFAIL  :  seqment size is not correct
hugeshmget01    1  TFAIL  :  hugeshmget01 call failed - errno = 17 :
File exists
                ......

In shmget call,
"buf.shm_segsz" had been set to "huge_pages_shm_to_be_allocated", but the code still used old macro "HUGE_SHM_SIZE", and this leaded to error "seqment size is not correct".

Quoted 8 lines

So do the following change:
1) s/HUGE_SHM_SIZE/huge_pages_shm_to_be_allocated
2) Delete unused macro "HUGE_SHM_SIZE" defination

This patch fixed the failure.

Thanks.

Regards--
Subrata

Quoted 23 lines
---
 .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c   |    2 +-
 testcases/kernel/mem/hugetlb/lib/ipcshm.h          |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +1 -1
index 0486dc3..10f29d3 100644
@@ -109,7 +109,7 @@ int main(int ac, char **av)
 					continue;
 				}
 				/* check the seqment size */
-				if (buf.shm_segsz != HUGE_SHM_SIZE) {
+				if (buf.shm_segsz != huge_pages_shm_to_be_allocated) {
 					tst_resm(TFAIL, "seqment size is not "
 						 "correct");
 					continue;
testcases/kernel/mem/hugetlb/lib/ipcshm.h +0 -0
index 5b92530..caac9af 100644

testcases/kernel/mem/hugetlb/lib/ipcshm.h void setup(void); · line 47

Quoted 7 lines
testcases/kernel/mem/hugetlb/lib/ipcshm.h +0 -1
@@ -42,7 +42,6 @@ void setup(void);
 #define SHM_HUGETLB   04000    /* segment is mapped via hugetlb */
 #endif
 
-#define HUGE_SHM_SIZE	(256UL*1024UL*1024UL)	/* a resonable size for a large page segment */
 
 #define MODE_MASK	0x01FF			/* to get the lower nine permission bits */
 						/* from shmid_ds.ipc_perm.mode		 */

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list