Michal Simek wrote:
> Hi All,
>
> don't you know what is the description of f_bavail in struct statvfs?
> On my system I am getting zero for this entry that's why fsync02 failed.
>
I track down where the problem comes from.
There is problem for all fs which use simple_statfs function from
fs/libfs.c.
In open.c in vfs_statfs function is whole structure set to zero and then
in simple_statfs not set this value.
I think we should fix it in ltp code.
Here is my proposed change. If is ok - I will generate proper patch.
Thanks,
Michal
diff --git a/testcases/kernel/syscalls/fsync/fsync02.c
b/testcases/kernel/syscalls/fsync/fsync02.c
index 7ba2c50..e2d58d7 100644
--- a/testcases/kernel/syscalls/fsync/fsync02.c
+++ b/testcases/kernel/syscalls/fsync/fsync02.c
@@ -166,6 +166,9 @@ int main(int ac, char **av)
*/
void setup()
{
+ /* free blocks avail to non-superuser */
+ unsigned long f_bavail;
+
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
@@ -187,9 +190,10 @@ void setup()
"file system");
}
- if ((stat_buf.f_bavail / (BLOCKSIZE / stat_buf.f_frsize)) <
MAXBLKS) {
- max_blks = stat_buf.f_bavail / (BLOCKSIZE /
stat_buf.f_frsize);
- }
+ f_bavail = stat_buf.f_bavail / (BLOCKSIZE / stat_buf.f_frsize);
+ if (f_bavail && (f_bavail < MAXBLKS))
+ max_blks = f_bavail;
+
#ifdef LARGEFILE
if ((fcntl(fd, F_SETFL, O_LARGEFILE)) == -1) {
tst_brkm(TBROK, cleanup, "fcntl failed to O_LARGEFILE");
> Thanks,
> Michal
>
>
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list