From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Wi5Ka-0003vP-B1 for ltp-list@lists.sourceforge.net; Wed, 07 May 2014 17:08:32 +0000 Date: Wed, 7 May 2014 19:07:32 +0200 From: chrubis@suse.cz Message-ID: <20140507170732.GC1916@rei> References: <1398391328-13711-1-git-send-email-wangxg.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1398391328-13711-1-git-send-email-wangxg.fnst@cn.fujitsu.com> Subject: Re: [LTP] [PATCH v3 1/2] lib/tst_fs_has_free.c: add tst_fs_has_free() to determine filesystem's free space List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Xiaoguang Wang Cc: ltp-list@lists.sourceforge.net 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: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • 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