public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] fsync02: SIGFPE fix
@ 2013-11-06 10:32 Stanislav Kholmanskikh
  2013-11-06 13:06 ` chrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Kholmanskikh @ 2013-11-06 10:32 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko

It may happen that stat_buf.f_frsize is greater than
BLOCKSIZE (for example, if we use "non-default" FS block sizes or NFS) and
because on (BLOCKSIZE / stat_buf.f_frsize) is 0.

Moved stat_buf.f_frsize to the dividend.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
 testcases/kernel/syscalls/fsync/fsync02.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/fsync/fsync02.c b/testcases/kernel/syscalls/fsync/fsync02.c
index 564f5c6..ffd2e7a 100644
--- a/testcases/kernel/syscalls/fsync/fsync02.c
+++ b/testcases/kernel/syscalls/fsync/fsync02.c
@@ -177,7 +177,7 @@ void setup()
 	if (fstatvfs(fd, &stat_buf) != 0)
 		tst_brkm(TBROK, cleanup, "fstatvfs failed");
 
-	f_bavail = stat_buf.f_bavail / (BLOCKSIZE / stat_buf.f_frsize);
+	f_bavail = (stat_buf.f_bavail * stat_buf.f_frsize) / BLOCKSIZE;
 	if (f_bavail && (f_bavail < MAXBLKS))
 		max_blks = f_bavail;
 
-- 
1.7.1


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
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] fsync02: SIGFPE fix
  2013-11-06 10:32 [LTP] [PATCH] fsync02: SIGFPE fix Stanislav Kholmanskikh
@ 2013-11-06 13:06 ` chrubis
  0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2013-11-06 13:06 UTC (permalink / raw)
  To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list

Hi!
> It may happen that stat_buf.f_frsize is greater than
> BLOCKSIZE (for example, if we use "non-default" FS block sizes or NFS) and
> because on (BLOCKSIZE / stat_buf.f_frsize) is 0.
> 
> Moved stat_buf.f_frsize to the dividend.
> 
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
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:[~2013-11-06 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 10:32 [LTP] [PATCH] fsync02: SIGFPE fix Stanislav Kholmanskikh
2013-11-06 13:06 ` chrubis

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