]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: check if device support discard in xfs_ioc_trim()
authorLukas Czerner <lczerner@redhat.com>
Tue, 15 Feb 2011 17:07:36 +0000 (17:07 +0000)
committerAlex Elder <aelder@sgi.com>
Tue, 22 Feb 2011 21:08:44 +0000 (15:08 -0600)
commitf809bc6fe90d65d7e644dccb5e7e568376b9aaed
treef16e9241cd872adab59485e66523f9fb7eb7ab3b
parent8a7c0847c2620277dc7245d17c01e33279817f3b
xfs: check if device support discard in xfs_ioc_trim()

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>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/linux-2.6/xfs_discard.c