linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2] ext4: check if device support discard in FITRIM ioctl
Date: Wed, 23 Feb 2011 12:50:23 -0500	[thread overview]
Message-ID: <20110223175023.GN2924@thunk.org> (raw)
In-Reply-To: <1297789585-5986-1-git-send-email-lczerner@redhat.com>

On Tue, Feb 15, 2011 at 06:06:24PM +0100, Lukas Czerner wrote:
> Right now we, are relying on the fact that when we attempt to actually do
> the discard, blkdev_issue_discar() returns -EOPNOTSUPP and the user is
> informed that the device does not support discard.
> 
> However, in the case where the we do not hit any suitable free extent to
> trim in FITRIM code, it will finish without any error. This is very
> confusing, because it seems that FITRIM was successful even though the
> device does not actually supports discard.
> 
> Solution: Check for the discard support before attempt to search for
> free extents.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Added to the ext4 patch queue, but I rewrote the commit description to
make it more understable.

						- Ted

ext4: check if device support discard in FITRIM ioctl

From: Lukas Czerner <lczerner@redhat.com>

For a device that does not support discard, the FITRIM ioctl returns
-EOPNOTSUPP when blkdev_issue_discard() returns this error code, which
is how the user is informed that the device does not support discard.

If there are no suitable free extents to be trimmed, then FITRIM will
return success even though the device does not support discard, which
could confuse the user.  So check explicitly if the device supports
discard and return an error code at the beginning of the FITRIM ioctl
processing.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

      parent reply	other threads:[~2011-02-23 17:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 17:06 [PATCH 1/2] ext4: check if device support discard in FITRIM ioctl Lukas Czerner
2011-02-15 17:06 ` [PATCH 2/2] ext4: Adjust mineln with discard_granularity in FITRIM code Lukas Czerner
2011-02-23 17:58   ` Ted Ts'o
2011-02-23 18:19     ` Lukas Czerner
2011-02-23 17:50 ` Ted Ts'o [this message]

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=20110223175023.GN2924@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@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).