public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v3 1/2] lib/tst_fs_has_free.c: add tst_fs_has_free() to determine filesystem's free space
Date: Wed, 7 May 2014 19:07:32 +0200	[thread overview]
Message-ID: <20140507170732.GC1916@rei> (raw)
In-Reply-To: <1398391328-13711-1-git-send-email-wangxg.fnst@cn.fujitsu.com>

Hi!
> +	if ((uint64_t)sf.f_bfree * sf.f_bsize > (uint64_t)size * mult)

While I've tried this code I've found that we should rather be using
sf.f_bavail than sf.f_bfree.

Because f_bfree describes total free blocks while f_bavail describes
block available to use for unprivileged user. So if some test asks for
30GB and the code that creates the file runs as unprivileged user it may
still fail even after this check was successful.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      parent reply	other threads:[~2014-05-07 17:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  2:02 [LTP] [PATCH v3 1/2] lib/tst_fs_has_free.c: add tst_fs_has_free() to determine filesystem's free space Xiaoguang Wang
2014-04-25  2:02 ` [LTP] [PATCH v3 2/2] tools/apicmd: add tst_fs_has_free Xiaoguang Wang
2014-05-07 17:03   ` chrubis
2014-05-07 13:56 ` [LTP] [PATCH v3 1/2] lib/tst_fs_has_free.c: add tst_fs_has_free() to determine filesystem's free space chrubis
2014-05-07 17:07 ` chrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140507170732.GC1916@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox