From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH 1/2] ext4: Notify when discard is not supported
Date: Fri, 19 Oct 2012 14:12:37 +0200 [thread overview]
Message-ID: <1350648758-3318-1-git-send-email-lczerner@redhat.com> (raw)
Notify user when mounting the file system with -o discard option, but
the device does not support discard. Obviously we do not want to fail
the mount or disable the options, because the underlying device might
change in future even without file system remount.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
fs/ext4/super.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 7265a03..fd3ff41 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4017,6 +4017,14 @@ no_journal:
}
#endif /* CONFIG_QUOTA */
+ if (test_opt(sb, DISCARD)) {
+ struct request_queue *q = bdev_get_queue(sb->s_bdev);
+ if (!blk_queue_discard(q))
+ ext4_msg(sb, KERN_WARNING,
+ "mounting with \"discard\" option, but "
+ "the device does not support discard");
+ }
+
ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. "
"Opts: %s%s%s", descr, sbi->s_es->s_mount_opts,
*sbi->s_es->s_mount_opts ? "; " : "", orig_data);
--
1.7.7.6
next reply other threads:[~2012-10-19 12:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 12:12 Lukas Czerner [this message]
2012-10-19 12:12 ` [PATCH 2/2] ext4: Warn when discard request fails other than EOPNOTSUPP Lukas Czerner
2012-10-23 13:15 ` Carlos Maiolino
2012-11-08 11:08 ` Lukáš Czerner
2012-11-08 19:10 ` Theodore Ts'o
2012-10-23 13:14 ` [PATCH 1/2] ext4: Notify when discard is not supported Carlos Maiolino
2012-11-08 18:28 ` Theodore 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=1350648758-3318-1-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.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 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).