public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH] mmapstress10:Close the file descriptor
@ 2013-05-28  3:42 shuang.qiu
  2013-05-28  7:59 ` Jan Stancek
  2013-05-28  8:03 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: shuang.qiu @ 2013-05-28  3:42 UTC (permalink / raw)
  To: ltp-list

From: Shuang Qiu <shuang.qiu@oracle.com>

It does not close the file descriptor before return 1 in fileokey()
function which may cause the following warning with nfs as TMPDIR:
0  TWARN  :  tst_rmdir: rmobj(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt)
failed:
unlink(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt/.nfs000000000110cb3600000004)
failed; errno=16: Device or resource busy

Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
 testcases/kernel/mem/mmapstress/mmapstress10.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/mem/mmapstress/mmapstress10.c b/testcases/kernel/mem/mmapstress/mmapstress10.c
index baddaff..8ee7c87 100644
--- a/testcases/kernel/mem/mmapstress/mmapstress10.c
+++ b/testcases/kernel/mem/mmapstress/mmapstress10.c
@@ -876,6 +876,7 @@ int fileokay(char *file, uchar_t * expbuf)
 		}
 	}
 
+	close(fd);
 	return 1;
 }
 
-- 
1.7.7


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
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] mmapstress10:Close the file descriptor
  2013-05-28  3:42 [LTP] [PATCH] mmapstress10:Close the file descriptor shuang.qiu
@ 2013-05-28  7:59 ` Jan Stancek
  2013-05-28  8:03 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2013-05-28  7:59 UTC (permalink / raw)
  To: shuang qiu; +Cc: ltp-list





----- Original Message -----
> From: "shuang qiu" <shuang.qiu@oracle.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Tuesday, 28 May, 2013 5:42:08 AM
> Subject: [LTP]  [PATCH] mmapstress10:Close the file descriptor
> 
> From: Shuang Qiu <shuang.qiu@oracle.com>
> 
> It does not close the file descriptor before return 1 in fileokey()
> function which may cause the following warning with nfs as TMPDIR:
> 0  TWARN  :  tst_rmdir: rmobj(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt)
> failed:
> unlink(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt/.nfs000000000110cb3600000004)
> failed; errno=16: Device or resource busy
> 
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>

Looks good to me.
commit 76a720a381f351b33eb203c7c519e6f44bbe7219 added some to error paths,
but missed this one.

Reviewed-by: Jan Stancek <jstancek@redhat.com>

> ---
>  testcases/kernel/mem/mmapstress/mmapstress10.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/testcases/kernel/mem/mmapstress/mmapstress10.c
> b/testcases/kernel/mem/mmapstress/mmapstress10.c
> index baddaff..8ee7c87 100644
> --- a/testcases/kernel/mem/mmapstress/mmapstress10.c
> +++ b/testcases/kernel/mem/mmapstress/mmapstress10.c
> @@ -876,6 +876,7 @@ int fileokay(char *file, uchar_t * expbuf)
>  		}
>  	}
>  
> +	close(fd);
>  	return 1;
>  }
>  
> --
> 1.7.7
> 
> 
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
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] mmapstress10:Close the file descriptor
  2013-05-28  3:42 [LTP] [PATCH] mmapstress10:Close the file descriptor shuang.qiu
  2013-05-28  7:59 ` Jan Stancek
@ 2013-05-28  8:03 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2013-05-28  8:03 UTC (permalink / raw)
  To: shuang.qiu; +Cc: ltp-list

On 05/28/2013 11:42 AM, shuang.qiu@oracle.com wrote:
> From: Shuang Qiu <shuang.qiu@oracle.com>
> 
> It does not close the file descriptor before return 1 in fileokey()
> function which may cause the following warning with nfs as TMPDIR:
> 0  TWARN  :  tst_rmdir: rmobj(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt)
> failed:
> unlink(/mnt/nfsv3/ltp-SDrfq17456/mmaq7TOqt/.nfs000000000110cb3600000004)
> failed; errno=16: Device or resource busy
> 
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>

Applied, thank you.

Wanlong Gao


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
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:[~2013-05-28  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28  3:42 [LTP] [PATCH] mmapstress10:Close the file descriptor shuang.qiu
2013-05-28  7:59 ` Jan Stancek
2013-05-28  8:03 ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox