Thread (5 messages) 5 messages, 2 authors, 2011-02-23

Re: [PATCH 1/2] ext4: check if device support discard in FITRIM ioctl

From: Ted Ts'o <tytso@mit.edu>
Date: 2011-02-23 17:50:26

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 <redacted>
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 <redacted>

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 <redacted>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help