From: Dmitry Monakhov <dmonakhov@openvz.org>
To: xfs@oss.sgi.com
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
dchinner@redhat.com, Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 1/4] large-fs: fix large_fs space detection
Date: Tue, 9 Jul 2013 15:05:15 +0400 [thread overview]
Message-ID: <1373367918-7516-1-git-send-email-dmonakhov@openvz.org> (raw)
Currenly large_fs check compare $SCRATCH_DEV_EMPTY_SPACE and $fs_size
which is not correct because total empty size required is $SCRATCH_DEV_EMPTY_SPACE + 50Gb
This path fix space detection, so check becomes valid for all situations.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
common/rc | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/common/rc b/common/rc
index fe6bbfc..c44acea 100644
--- a/common/rc
+++ b/common/rc
@@ -306,16 +306,17 @@ _setup_large_xfs_fs()
{
fs_size=$1
local tmp_dir=/tmp/
+ # Default free space in the FS is 50GB, but you can specify more via
+ # SCRATCH_DEV_EMPTY_SPACE
+ fs_empty_space=$((50*1024*1024*1024))
[ "$LARGE_SCRATCH_DEV" != yes ] && return 0
- [ -z "$SCRATCH_DEV_EMPTY_SPACE" ] && SCRATCH_DEV_EMPTY_SPACE=0
- [ $SCRATCH_DEV_EMPTY_SPACE -ge $fs_size ] && return 0
+ [ -z "$SCRATCH_DEV_EMPTY_SPACE" ] && SCRATCH_DEV_EMPTY_SPACE=0
+ fs_empty_space=$((fs_empty_space + $SCRATCH_DEV_EMPTY_SPACE))
+ [ $fs_empty_space -ge $fs_size ] && return 0
# calculate the size of the file we need to allocate.
- # Default free space in the FS is 50GB, but you can specify more via
- # SCRATCH_DEV_EMPTY_SPACE
- file_size=$(($fs_size - 50*1024*1024*1024))
- file_size=$(($file_size - $SCRATCH_DEV_EMPTY_SPACE))
+ file_size=$(($fs_size - $fs_empty_space))
# mount the filesystem, create the file, unmount it
_scratch_mount 2>&1 >$tmp_dir/mnt.err
@@ -434,15 +435,17 @@ _setup_large_ext4_fs()
{
fs_size=$1
local tmp_dir=/tmp/
-
- [ "$LARGE_SCRATCH_DEV" != yes ] && return 0
- [ -z "$SCRATCH_DEV_EMPTY_SPACE" ] && SCRATCH_DEV_EMPTY_SPACE=0
- [ $SCRATCH_DEV_EMPTY_SPACE -ge $fs_size ] && return 0
next reply other threads:[~2013-07-09 11:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 11:05 Dmitry Monakhov [this message]
2013-07-09 11:05 ` [PATCH 2/4] large-fs: improve space diversification for ext4 Dmitry Monakhov
2013-07-11 1:10 ` Dave Chinner
2013-07-09 11:05 ` [PATCH 3/4] ext4: ignore valid errors from defragmentation tests Dmitry Monakhov
2013-07-11 1:11 ` Dave Chinner
2013-07-09 11:05 ` [PATCH 4/4] large-fs: fix ext4 " Dmitry Monakhov
2013-07-11 1:17 ` Dave Chinner
2013-07-11 0:54 ` [PATCH 1/4] large-fs: fix large_fs space detection Dave Chinner
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=1373367918-7516-1-git-send-email-dmonakhov@openvz.org \
--to=dmonakhov@openvz.org \
--cc=dchinner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).