io/diotest4: Close open fd after testing
PATCH 1/1 io/diotest4: Close open fd after testing
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in NFS mount. The tst_rmdir() in cleanup() in diotest4.c complains about "Device or resource busy"
Close open fd after each sub-test.
--- testcases/kernel/io/direct_io/diotest4.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
testcases/kernel/io/direct_io/diotest4.c +4 -0
@@ -324,6 +324,7 @@ main(int argc, char *argv[])else tst_resm (TPASS ,"Out of range file descriptor" ); } +close (newfd); total++;/* Test-7: Closed file descriptor */
@@ -360,6 +361,7 @@ main(int argc, char *argv[])else tst_resm (TPASS ,"character device read, write" ); } +close (newfd); total++;/* Test-10: read, write to a mmaped file */
@@ -400,6 +402,7 @@ main(int argc, char *argv[]) }else tst_resm (TPASS ,"read, write to an unmapped file" ); +close (fd); total++;/* Test-12: read from file not open for reading */
@@ -610,6 +613,7 @@ static void setup(void)if ((fd1 =open (filename,O_DIRECT ,0600 )) <0 ) {tst_brkm (TCONF , cleanup,"O_DIRECT is not supported by this filesystem. %s" ,strerror (errno)); } +close (fd1); }static void cleanup (void )
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 8 lines · Eryu Guan
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in NFS mount. The
tst_rmdir()incleanup()indiotest4.ccomplains about "Device or resource busy"Close open fd after each sub-test.
Signed-off-by Eryu Guan <[email protected]>
Hi, Committed, thanks.
-Caspar
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list