* Re: [LTP] [PATCH 2/2] open_posix:aio_fsync:14-1: wait for aio_write completion [not found] ` <500E1E39.3050704@cn.fujitsu.com> @ 2012-07-24 5:42 ` Garrett Cooper [not found] ` <1343109556-12022-1-git-send-email-gaowanlong@cn.fujitsu.com> 0 siblings, 1 reply; 4+ messages in thread From: Garrett Cooper @ 2012-07-24 5:42 UTC (permalink / raw) To: gaowanlong@cn.fujitsu.com; +Cc: LTP Sent from my iPhone On Jul 23, 2012, at 9:02 PM, Wanlong Gao <gaowanlong@cn.fujitsu.com> wrote: > On 07/24/2012 11:49 AM, Caspar Zhang wrote: >> On 07/24/2012 10:58 AM, Wanlong Gao wrote: >>> Wait for aio_write() completion. >>> If aio_fsync() sync the fd without the previous aio_write() >>> completion, it will cause Segment Fault. >>> >>> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> >>> --- >>> .../open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c | 9 +++++++++ >>> 1 file changed, 9 insertions(+) >>> >>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >>> index a9cd3bf..e15f084 100644 >>> --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >>> @@ -27,6 +27,7 @@ int main() >>> #define BUF_SIZE 111 >>> char buf[BUF_SIZE]; >>> int fd; >>> + int ret; >>> struct aiocb aiocb_write; >>> struct aiocb aiocb_fsync; >>> >>> @@ -57,6 +58,14 @@ int main() >>> exit(PTS_FAIL); >>> } >>> >>> + while ((ret = aio_error(&aiocb_write) == EINPROGRESS)) >> >> I think checkpatch.pl would complain here. > > Not really. > It should be assigned in while() here, can't be split to two lines. Or you could use a do-while.. >> >>> + usleep(10000); >>> + if (ret < 0) { >>> + printf(TNAME " Error at aio_error() : %s\n", strerror(ret)); >>> + exit(PTS_FAIL); >>> + } >>> + >>> + >>> memset(&aiocb_fsync, 0, sizeof(aiocb_fsync)); >>> aiocb_fsync.aio_fildes = fd; >>> >>> >> >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Ltp-list mailing list > Ltp-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ltp-list ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <1343109556-12022-1-git-send-email-gaowanlong@cn.fujitsu.com>]
* Re: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion [not found] ` <1343109556-12022-1-git-send-email-gaowanlong@cn.fujitsu.com> @ 2012-07-24 7:16 ` Nitin Yadav 2012-07-24 8:19 ` Wanlong Gao 0 siblings, 1 reply; 4+ messages in thread From: Nitin Yadav @ 2012-07-24 7:16 UTC (permalink / raw) To: Wanlong Gao, LTP Hi Wanlong, Even I am getting error io_fsync write: Invalid argument, while running io test cases on linux 3.2 kernel.Below are the outputs for error. aio02/aio_tio 0 TINFO : Running test 1 aio02/aio_tio 0 TINFO : Running test 2 aio02/aio_tio 0 TINFO : Running test 3 aio02/aio_tio 0 TINFO : Running test 4 aio02/aio_tio 0 TINFO : Running test 5 aio02/aio_tio 0 TINFO : Running test 6 aio02/aio_tio 0 TINFO : Running test 7 io_fsync write: Invalid argument Could you please suggest me some pointer. Thanks! Nitin yadav -----Original Message----- From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] Sent: Tuesday, July 24, 2012 11:29 AM To: LTP Subject: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion Wait for aio_write() completion. If aio_fsync() sync the fd without the previous aio_write() completion, it will cause Segment Fault. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- .../conformance/interfaces/aio_fsync/14-1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c index a9cd3bf..02ba8a5 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c @@ -27,6 +27,7 @@ int main() #define BUF_SIZE 111 char buf[BUF_SIZE]; int fd; + int ret; struct aiocb aiocb_write; struct aiocb aiocb_fsync; @@ -57,6 +58,15 @@ int main() exit(PTS_FAIL); } + do { + usleep(10000); + ret = aio_error(&aiocb_write); + } while (ret == EINPROGRESS); + if (ret < 0) { + printf(TNAME " Error at aio_error() : %s\n", strerror(ret)); + exit(PTS_FAIL); + } + memset(&aiocb_fsync, 0, sizeof(aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -- 1.7.11.3.287.ge771946 ------------------------------------------------------------------------ ------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion 2012-07-24 7:16 ` [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion Nitin Yadav @ 2012-07-24 8:19 ` Wanlong Gao [not found] ` <E351E450E8B9F54684A699D42DC5ADF223011877@MPBAGVEX02.corp.mphasis.com> 0 siblings, 1 reply; 4+ messages in thread From: Wanlong Gao @ 2012-07-24 8:19 UTC (permalink / raw) To: Nitin Yadav; +Cc: LTP On 07/24/2012 03:16 PM, Nitin Yadav wrote: > Hi Wanlong, > Even I am getting error io_fsync write: Invalid argument, while running > io test cases on linux 3.2 kernel.Below are the outputs for error. > > aio02/aio_tio 0 TINFO : Running test 1 > > aio02/aio_tio 0 TINFO : Running test 2 > > aio02/aio_tio 0 TINFO : Running test 3 > > aio02/aio_tio 0 TINFO : Running test 4 > > aio02/aio_tio 0 TINFO : Running test 5 > > aio02/aio_tio 0 TINFO : Running test 6 > > aio02/aio_tio 0 TINFO : Running test 7 > > io_fsync write: Invalid argument > io_fsync() calls the syscall io_submit(). when doing IO_CMD_FSYNC and IO_CMD_FDSYNC, Linux kernel will involve the filesystem's aio_fsync and aio_fdsync operations, and if the filesystem doesn't implement these two operations, it will return -EINVAL, this is the error you meet here. In fact, the syscall io_submit() in kernel is asynchronous, and the performance is better than adding a outstanding asynchronous aio_* operations. In general, this CMD is not implemented in Linux kernel. Thanks, Wanlong Gao > > Could you please suggest me some pointer. > > Thanks! > Nitin yadav > > -----Original Message----- > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] > Sent: Tuesday, July 24, 2012 11:29 AM > To: LTP > Subject: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for > aio_writecompletion > > Wait for aio_write() completion. > If aio_fsync() sync the fd without the previous aio_write() > completion, it will cause Segment Fault. > > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> > --- > .../conformance/interfaces/aio_fsync/14-1.c | 10 > ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git > a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c > b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c > index a9cd3bf..02ba8a5 100644 > --- > a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c > +++ > b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c > @@ -27,6 +27,7 @@ int main() > #define BUF_SIZE 111 > char buf[BUF_SIZE]; > int fd; > + int ret; > struct aiocb aiocb_write; > struct aiocb aiocb_fsync; > > @@ -57,6 +58,15 @@ int main() > exit(PTS_FAIL); > } > > + do { > + usleep(10000); > + ret = aio_error(&aiocb_write); > + } while (ret == EINPROGRESS); > + if (ret < 0) { > + printf(TNAME " Error at aio_error() : %s\n", > strerror(ret)); > + exit(PTS_FAIL); > + } > + > memset(&aiocb_fsync, 0, sizeof(aiocb_fsync)); > aiocb_fsync.aio_fildes = fd; > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <E351E450E8B9F54684A699D42DC5ADF223011877@MPBAGVEX02.corp.mphasis.com>]
* Re: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion [not found] ` <E351E450E8B9F54684A699D42DC5ADF223011877@MPBAGVEX02.corp.mphasis.com> @ 2012-07-24 8:53 ` Wanlong Gao 0 siblings, 0 replies; 4+ messages in thread From: Wanlong Gao @ 2012-07-24 8:53 UTC (permalink / raw) To: Nitin Yadav; +Cc: LTP List On 07/24/2012 04:49 PM, Nitin Yadav wrote: > Thanks for your quick reply :-) You are always welcome. Wanlong Gao > > Thanks, > Nitin Yadav > > -----Original Message----- > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] > Sent: Tuesday, July 24, 2012 1:49 PM > To: Nitin Yadav > Cc: LTP > Subject: Re: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for > aio_writecompletion > > On 07/24/2012 03:16 PM, Nitin Yadav wrote: >> Hi Wanlong, >> Even I am getting error io_fsync write: Invalid argument, while > running >> io test cases on linux 3.2 kernel.Below are the outputs for error. >> >> aio02/aio_tio 0 TINFO : Running test 1 >> >> aio02/aio_tio 0 TINFO : Running test 2 >> >> aio02/aio_tio 0 TINFO : Running test 3 >> >> aio02/aio_tio 0 TINFO : Running test 4 >> >> aio02/aio_tio 0 TINFO : Running test 5 >> >> aio02/aio_tio 0 TINFO : Running test 6 >> >> aio02/aio_tio 0 TINFO : Running test 7 >> >> io_fsync write: Invalid argument >> > > io_fsync() calls the syscall io_submit(). > when doing IO_CMD_FSYNC and IO_CMD_FDSYNC, Linux kernel > will involve the filesystem's aio_fsync and aio_fdsync > operations, and if the filesystem doesn't implement > these two operations, it will return -EINVAL, this is > the error you meet here. > In fact, the syscall io_submit() in kernel is asynchronous, > and the performance is better than adding a outstanding > asynchronous aio_* operations. > In general, this CMD is not implemented in Linux kernel. > > Thanks, > Wanlong Gao > > >> >> Could you please suggest me some pointer. >> >> Thanks! >> Nitin yadav >> >> -----Original Message----- >> From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] >> Sent: Tuesday, July 24, 2012 11:29 AM >> To: LTP >> Subject: [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for >> aio_writecompletion >> >> Wait for aio_write() completion. >> If aio_fsync() sync the fd without the previous aio_write() >> completion, it will cause Segment Fault. >> >> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> >> --- >> .../conformance/interfaces/aio_fsync/14-1.c | 10 >> ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git >> > a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >> > b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >> index a9cd3bf..02ba8a5 100644 >> --- >> > a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >> +++ >> > b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c >> @@ -27,6 +27,7 @@ int main() >> #define BUF_SIZE 111 >> char buf[BUF_SIZE]; >> int fd; >> + int ret; >> struct aiocb aiocb_write; >> struct aiocb aiocb_fsync; >> >> @@ -57,6 +58,15 @@ int main() >> exit(PTS_FAIL); >> } >> >> + do { >> + usleep(10000); >> + ret = aio_error(&aiocb_write); >> + } while (ret == EINPROGRESS); >> + if (ret < 0) { >> + printf(TNAME " Error at aio_error() : %s\n", >> strerror(ret)); >> + exit(PTS_FAIL); >> + } >> + >> memset(&aiocb_fsync, 0, sizeof(aiocb_fsync)); >> aiocb_fsync.aio_fildes = fd; >> >> > > > Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended > for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or > exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded > to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly > prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records. > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-24 8:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1343098694-8295-1-git-send-email-gaowanlong@cn.fujitsu.com>
[not found] ` <1343098694-8295-2-git-send-email-gaowanlong@cn.fujitsu.com>
[not found] ` <500E1B37.2060309@casparzhang.com>
[not found] ` <500E1E39.3050704@cn.fujitsu.com>
2012-07-24 5:42 ` [LTP] [PATCH 2/2] open_posix:aio_fsync:14-1: wait for aio_write completion Garrett Cooper
[not found] ` <1343109556-12022-1-git-send-email-gaowanlong@cn.fujitsu.com>
2012-07-24 7:16 ` [LTP] [PATCH V2] open_posix:aio_fsync:14-1: wait for aio_writecompletion Nitin Yadav
2012-07-24 8:19 ` Wanlong Gao
[not found] ` <E351E450E8B9F54684A699D42DC5ADF223011877@MPBAGVEX02.corp.mphasis.com>
2012-07-24 8:53 ` Wanlong Gao
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox