All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] io/diotest4: Close open fd after testing
@ 2011-12-26 11:31 Eryu Guan
  2011-12-26 12:01 ` Caspar Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Eryu Guan @ 2011-12-26 11:31 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]


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.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 testcases/kernel/io/direct_io/diotest4.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-io-diotest4-Close-open-fd-after-testing.patch --]
[-- Type: text/x-patch; name="0001-io-diotest4-Close-open-fd-after-testing.patch", Size: 1033 bytes --]

diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
index 1f1b44b..a256104 100644
--- a/testcases/kernel/io/direct_io/diotest4.c
+++ b/testcases/kernel/io/direct_io/diotest4.c
@@ -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)

[-- Attachment #3: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] io/diotest4: Close open fd after testing
  2011-12-26 11:31 [LTP] [PATCH] io/diotest4: Close open fd after testing Eryu Guan
@ 2011-12-26 12:01 ` Caspar Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Caspar Zhang @ 2011-12-26 12:01 UTC (permalink / raw)
  To: Eryu Guan; +Cc: ltp-list

On 12/26/2011 07:31 PM, Eryu Guan wrote:
> 
> 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.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>

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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-26 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-26 11:31 [LTP] [PATCH] io/diotest4: Close open fd after testing Eryu Guan
2011-12-26 12:01 ` Caspar Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.