Skip to contentSkip to conversation

Fix fallocate() build issue for EXT4 Online Defragmentation Test

PATCH In review Subrata Modak 3 participants 5 messages Mar 24, 2010 – Mar 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix fallocate() build issue for EXT4 Online Defragmentation Test

Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at /usr/include/bits/fcntl.h, so building EXT4 test cases on PPC64 machines will create build problems even if the pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include -I../../../../../include -L../../../../../lib e4defrag.c -lltp -lm -o e4defrag
e4defrag.c:388: error: conflicting types for ���fallocate��� /usr/include/bits/fcntl.h:240: note: previous declaration of ���fallocate��� was here make[1]: *** [e4defrag] Error 1
]

---

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c +3 -0
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
  * @offset:		file offset.
  * @len:		file size.
  */
+
+#ifndef __NR_fallocate
 int fallocate(int fd, int mode, loff_t offset, loff_t len)
 {
 	return syscall(__NR_fallocate, fd, mode, offset, len);
 }
+#endif
 
 /*
  * get_mount_point() -	Get device's mount point.

---
Regards--
Subrata Modak

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 28 lines · Subrata Modak

Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at /usr/include/bits/fcntl.h, so building EXT4 test cases on PPC64 machines will create build problems even if the pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall  -I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include -I../../../../../include   -L../../../../../lib  e4defrag.c   -lltp -lm -o e4defrag e4defrag.c:388: error: conflicting types for ‘fallocate’
/usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ was here
make[1]: *** [e4defrag] Error 1
]

---

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c        2010-03-24 18:09:14.336793513 +0530 int sync_file_range(int fd, loff_t offse · line 392

Quoted 10 lines
testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c        2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +3 -0
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
  * @offset:            file offset.
  * @len:               file size.
  */
+
+#ifndef __NR_fallocate
  int fallocate(int fd, int mode, loff_t offset, loff_t len)
  {
        return syscall(__NR_fallocate, fd, mode, offset, len);
  }
+#endif

If it's not defined, you're definitely in trouble because that
will result in a compile error. An autoconf test should be added for this syscall, and/or linux_syscall_numbers.h should be integrated into this test. That may be a bit heavy handed because that will integrate some libltp pieces into the tests, but that's up to Miao to decide. Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

Miao,

Quoted 38 lines · Garrett Cooper
Quoted 36 lines · Subrata Modak

Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at /usr/include/bits/fcntl.h, so building EXT4 test cases on PPC64 machines will create build problems even if the pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include -I../../../../../include -L../../../../../lib e4defrag.c -lltp -lm -o e4defrag
e4defrag.c:388: error: conflicting types for ‘fallocate’ /usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ was here make[1]: *** [e4defrag] Error 1
]

---

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +2 -0
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
 * @offset:            file offset.
 * @len:               file size.
 */
+
+#ifndef __NR_fallocate
 int fallocate(int fd, int mode, loff_t offset, loff_t len)
 {
       return syscall(__NR_fallocate, fd, mode, offset, len);
Quoted 8 lines

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 int sync_file_range(int fd, loff_t offse · line 392

Quoted 2 lines
testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +1 -0
 }
+#endif

If it's not defined, you're definitely in trouble because that
will result in a compile error. An autoconf test should be added for this syscall, and/or linux_syscall_numbers.h should be integrated into this test. That may be a bit heavy handed because that will integrate some libltp pieces into the tests, but that's up to Miao to decide.

Did you get a chance to check this patch ?

Regards--
Subrata

Quoted 2 lines

Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 50 lines · Subrata Modak

Miao,

Quoted 38 lines · Garrett Cooper
Quoted 36 lines · Subrata Modak

Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at /usr/include/bits/fcntl.h, so building EXT4 test cases on PPC64 machines will create build problems even if the pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall  -I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include -I../../../../../include   -L../../../../../lib  e4defrag.c   -lltp -lm -o e4defrag e4defrag.c:388: error: conflicting types for ‘fallocate’
/usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ was here
make[1]: *** [e4defrag] Error 1
]

---

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c        2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +2 -0
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
  * @offset:            file offset.
  * @len:               file size.
  */
+
+#ifndef __NR_fallocate
  int fallocate(int fd, int mode, loff_t offset, loff_t len)
  {
        return syscall(__NR_fallocate, fd, mode, offset, len);
Quoted 8 lines

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c        2010-03-24 18:09:14.336793513 +0530 int sync_file_range(int fd, loff_t offse · line 392

Quoted 2 lines
testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c        2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +1 -0
  }
+#endif

    If it's not defined, you're definitely in trouble because that will result in a compile error. An autoconf test should be added for this syscall, and/or linux_syscall_numbers.h should be integrated into this test. That may be a bit heavy handed because that will integrate some libltp pieces into the tests, but that's up to Miao to decide.

Quoted 4 lines

Did you get a chance to check this patch ?

Regards--
Subrata

Nope, but my concern still stands unaddressed.
Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
In reply to Subrata Modak

Hi, Subrata.

Sorry! Reply is late.

Quoted 45 lines · Subrata Modak
Quoted 36 lines
Quoted 36 lines

Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at /usr/include/bits/fcntl.h, so building EXT4 test cases on PPC64 machines will create build problems even if the pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include -I../../../../../include -L../../../../../lib e4defrag.c -lltp -lm -o e4defrag
e4defrag.c:388: error: conflicting types for ‘fallocate’ /usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ was here make[1]: *** [e4defrag] Error 1
]

---

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +2 -0
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
 * @offset:            file offset.
 * @len:               file size.
 */
+
+#ifndef __NR_fallocate
 int fallocate(int fd, int mode, loff_t offset, loff_t len)
 {
       return syscall(__NR_fallocate, fd, mode, offset, len);
Quoted 8 lines

testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 int sync_file_range(int fd, loff_t offse · line 392

Quoted 2 lines
testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-24 18:09:14.336793513 +0530 renamed from testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 2010-03-15 19:32:12.000000000 +0530 +1 -0
 }
+#endif

If it's not defined, you're definitely in trouble because that
will result in a compile error. An autoconf test should be added for this syscall, and/or linux_syscall_numbers.h should be integrated into this test. That may be a bit heavy handed because that will integrate some libltp pieces into the tests, but that's up to Miao to decide.

Quoted 1 line

Did you get a chance to check this patch ?

I found that the latest e4defrag was released and had been merged into the latest version(1.4.11) of e2fsprogs. So I think we should update e4defrag.c in LTP to the latest version. I think if e4defrag is installed into the system, we needn't use e4defrag in the LTP. If not, we use e4defrag in the LTP.

And before compiling ext4-new-features testcases, we do an autoconf test and check whether fallocate() has been defined or not, just like header files check.

Regards
Miao

Quoted 10 lines

Regards--
Subrata

Quoted 2 lines

Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list