From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] mke2fs: add discard to default mke2fs.conf and disable by default
Date: Wed, 17 Apr 2013 15:04:58 -0700 [thread overview]
Message-ID: <516F1C8A.9040702@redhat.com> (raw)
Discard is a very big hammer. If it succeeds, there's no undo
or going back; on the other hand, on some devices the giant discard
issued at mkfs time makes them go offline. :(
Although I'm reluctant to waffle back and forth on default behavior,
I think this disabling it by default the prudent thing to do.
This patch also adds the discard option into the default mke2fs.conf
file; although it could be set, it was not in the template.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
If disabling by default isn't desired, we should at least include
the mke2fs.conf.in change (set to 1).
Thanks,
-Eric
diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
index 023ba49..a005eca 100644
--- a/misc/mke2fs.8.in
+++ b/misc/mke2fs.8.in
@@ -277,11 +277,11 @@ Attempt to discard blocks at mkfs time (discarding blocks initially is useful
on solid state devices and sparse / thin-provisioned storage). When the device
advertises that discard also zeroes data (any subsequent read after the discard
and before write returns zero), then mark all not-yet-zeroed inode tables as
-zeroed. This significantly speeds up filesystem initialization. This is set
-as default.
+zeroed. This significantly speeds up filesystem initialization. This is disabled
+by default.
.TP
.BI nodiscard
-Do not attempt to discard blocks at mkfs time.
+Do not attempt to discard blocks at mkfs time. This is the default.
.TP
.BI quotatype
Specify which quota type ('usr' or 'grp') is to be initialized. This
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index bbf477a..d723ee7 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -84,7 +84,7 @@ int cflag;
int verbose;
int quiet;
int super_only;
-int discard = 1; /* attempt to discard device before fs creation */
+int discard; /* attempt to discard device before fs creation? */
int direct_io;
int force;
int noaction;
diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
index 178733f..db6decb 100644
--- a/misc/mke2fs.conf.in
+++ b/misc/mke2fs.conf.in
@@ -2,6 +2,7 @@
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
default_mntopts = acl,user_xattr
enable_periodic_fsck = 0
+ discard = 0
blocksize = 4096
inode_size = 256
inode_ratio = 16384
next reply other threads:[~2013-04-17 22:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 22:04 Eric Sandeen [this message]
2013-04-17 22:33 ` [PATCH] mke2fs: add discard to default mke2fs.conf and disable by default Eric Sandeen
2013-04-17 23:19 ` [PATCH V2] " Eric Sandeen
2013-04-18 23:09 ` Eric Sandeen
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=516F1C8A.9040702@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/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.