* [LTP] [PATCH] syscall/dup03: Close all open files in cleanup
@ 2011-11-11 4:52 Eryu Guan
2011-11-11 4:56 ` Caspar Zhang
2011-11-11 14:33 ` Cyril Hrubis
0 siblings, 2 replies; 3+ messages in thread
From: Eryu Guan @ 2011-11-11 4:52 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 625 bytes --]
The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in
NFS mount. The cleanup() in dup03.c doesn't close all open files and
leaves .nfsXXX file in the testing directory. Then rmdir(2) complains
about "Directory not empty".
dup03 1 TPASS : dup failed as expected with EMFILE
dup03 0 TWARN : tst_rmdir: rmobj(/mnt/nfs/dupxesX9v) failed: remove(/mnt/nfs/dupxesX9v) failed; errno=39: Directory not empty
So close all open files in cleanup().
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
testcases/kernel/syscalls/dup/dup03.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-syscall-dup03-Close-all-open-files-in-cleanup.patch --]
[-- Type: text/x-patch; name="0001-syscall-dup03-Close-all-open-files-in-cleanup.patch", Size: 392 bytes --]
diff --git a/testcases/kernel/syscalls/dup/dup03.c b/testcases/kernel/syscalls/dup/dup03.c
index 0b82956..6f29c21 100644
--- a/testcases/kernel/syscalls/dup/dup03.c
+++ b/testcases/kernel/syscalls/dup/dup03.c
@@ -217,8 +217,8 @@ void cleanup()
TEST_CLEANUP;
- for (i = 3; i <= nfds; i++)
+ for (i = 0; i <= nfds; i++)
close(fd[i]);
tst_rmdir();
-}
\ No newline at end of file
+}
[-- Attachment #3: Type: text/plain, Size: 169 bytes --]
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
[-- 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] 3+ messages in thread
* Re: [LTP] [PATCH] syscall/dup03: Close all open files in cleanup
2011-11-11 4:52 [LTP] [PATCH] syscall/dup03: Close all open files in cleanup Eryu Guan
@ 2011-11-11 4:56 ` Caspar Zhang
2011-11-11 14:33 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Caspar Zhang @ 2011-11-11 4:56 UTC (permalink / raw)
To: Eryu Guan; +Cc: ltp-list
On 11/11/2011 12:52 PM, Eryu Guan wrote:
>
> The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in
> NFS mount. The cleanup() in dup03.c doesn't close all open files and
> leaves .nfsXXX file in the testing directory. Then rmdir(2) complains
> about "Directory not empty".
>
> dup03 1 TPASS : dup failed as expected with EMFILE
> dup03 0 TWARN : tst_rmdir: rmobj(/mnt/nfs/dupxesX9v) failed: remove(/mnt/nfs/dupxesX9v) failed; errno=39: Directory not empty
>
> So close all open files in cleanup().
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
Acked-by: Caspar Zhang <caspar@casparzhang.com>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] syscall/dup03: Close all open files in cleanup
2011-11-11 4:52 [LTP] [PATCH] syscall/dup03: Close all open files in cleanup Eryu Guan
2011-11-11 4:56 ` Caspar Zhang
@ 2011-11-11 14:33 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2011-11-11 14:33 UTC (permalink / raw)
To: Eryu Guan; +Cc: ltp-list
Hi!
> The 'silly rename' mechanism of NFS creates temporary file .nfsXXX in
> NFS mount. The cleanup() in dup03.c doesn't close all open files and
> leaves .nfsXXX file in the testing directory. Then rmdir(2) complains
> about "Directory not empty".
Comited, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-11 14:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 4:52 [LTP] [PATCH] syscall/dup03: Close all open files in cleanup Eryu Guan
2011-11-11 4:56 ` Caspar Zhang
2011-11-11 14:33 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox