diff mbox

[4/4] Ext4 check for negative err from sb_issue_discard

Message ID 1280935813-4478-4-git-send-email-lczerner@redhat.com
State Superseded, archived
Headers show

Commit Message

Lukas Czerner Aug. 4, 2010, 3:30 p.m. UTC
sb_issue_discard is returning negative error code, so check for
negative value instead of positive.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/mballoc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Eric Sandeen Aug. 16, 2010, 4:57 p.m. UTC | #1
Lukas Czerner wrote:
> sb_issue_discard is returning negative error code, so check for
> negative value instead of positive.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
>  fs/ext4/mballoc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index a16a813..a8fe7f1 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2589,7 +2589,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
>  					(unsigned long long)discard_block,
>  					entry->count);
>  			ret = sb_issue_discard(sb, discard_block, entry->count);
> -			if (ret == EOPNOTSUPP) {
> +			if (ret == -EOPNOTSUPP) {
>  				ext4_warning(sb,
>  					"discard not supported, disabling");
>  				clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);

Thanks for fixing that, Lukas.  Dumb thinko on my part, too much
XFS (and weird positive-error usage) on the brain ;)

Ted, this can/should go in at any time, regardless of other discard
changes.

Thanks,
-Eric
--
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
diff mbox

Patch

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index a16a813..a8fe7f1 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2589,7 +2589,7 @@  static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
 					(unsigned long long)discard_block,
 					entry->count);
 			ret = sb_issue_discard(sb, discard_block, entry->count);
-			if (ret == EOPNOTSUPP) {
+			if (ret == -EOPNOTSUPP) {
 				ext4_warning(sb,
 					"discard not supported, disabling");
 				clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);