From: Kazuya Mio <k-mio@sx.jp.nec.com>
To: ext4 <linux-ext4@vger.kernel.org>, Theodore Tso <tytso@mit.edu>
Subject: [PATCH] e2fsprogs: Unify the upper limit of reserved blocks count
Date: Tue, 19 Apr 2011 15:11:34 +0900 [thread overview]
Message-ID: <4DAD2796.5010409@sx.jp.nec.com> (raw)
In e2fsprogs, the upper limit of reserved blocks count is a half of
filesystem's blocks count. This patch fixes the incorrect checks of
reserved blocks count.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
---
lib/ext2fs/initialize.c | 2 +-
misc/tune2fs.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index e1f229b..afefbfd 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -192,7 +192,7 @@ errcode_t ext2fs_initialize(const char *name, int flags,
ext2fs_blocks_count_set(super, ext2fs_blocks_count(param));
ext2fs_r_blocks_count_set(super, ext2fs_r_blocks_count(param));
- if (ext2fs_r_blocks_count(super) >= ext2fs_blocks_count(param)) {
+ if (ext2fs_r_blocks_count(super) > ext2fs_blocks_count(param) / 2) {
retval = EXT2_ET_INVALID_ARGUMENT;
goto cleanup;
}
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index bcada11..fad86c0 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1718,7 +1718,7 @@ retry_open:
reserved_ratio, ext2fs_r_blocks_count(sb));
}
if (r_flag) {
- if (reserved_blocks >= ext2fs_blocks_count(sb)/2) {
+ if (reserved_blocks > ext2fs_blocks_count(sb) / 2) {
com_err(program_name, 0,
_("reserved blocks count is too big (%llu)"),
reserved_blocks);
next reply other threads:[~2011-04-19 6:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 6:11 Kazuya Mio [this message]
2011-06-01 0:11 ` [PATCH] e2fsprogs: Unify the upper limit of reserved blocks count Ted Ts'o
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=4DAD2796.5010409@sx.jp.nec.com \
--to=k-mio@sx.jp.nec.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.