linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: Notify when discard is not supported
@ 2012-10-19 12:12 Lukas Czerner
  2012-10-19 12:12 ` [PATCH 2/2] ext4: Warn when discard request fails other than EOPNOTSUPP Lukas Czerner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lukas Czerner @ 2012-10-19 12:12 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Lukas Czerner

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-08 22:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 12:12 [PATCH 1/2] ext4: Notify when discard is not supported Lukas Czerner
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

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).