From: Carlos Maiolino <cmaiolino@redhat.com>
To: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2] ext4: Notify when discard is not supported
Date: Tue, 23 Oct 2012 11:14:19 -0200 [thread overview]
Message-ID: <20121023131419.GA14662@andromeda.usersys.redhat.com> (raw)
In-Reply-To: <1350648758-3318-1-git-send-email-lczerner@redhat.com>
On Fri, Oct 19, 2012 at 02:12:37PM +0200, Lukas Czerner wrote:
> 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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Looks good to me
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
--
--Carlos
next prev parent reply other threads:[~2012-10-23 13:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Carlos Maiolino [this message]
2012-11-08 18:28 ` [PATCH 1/2] ext4: Notify when discard is not supported 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=20121023131419.GA14662@andromeda.usersys.redhat.com \
--to=cmaiolino@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 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).