From: Lukas Czerner Date: Thu, 28 Oct 2010 01:30:03 +0000 (-0400) Subject: ext4: check for negative error code from sb_issue_discard X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=582987098207f1182ed5c7d01d5fedf7a5f56286;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ext4: check for negative error code from sb_issue_discard sb_issue_discard() is returning negative error code, so check for -EOPNOTSUPP. Signed-off-by: Lukas Czerner Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d4714d6cf7d9..53472e27b327 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2613,7 +2613,7 @@ static inline void ext4_issue_discard(struct super_block *sb, trace_ext4_discard_blocks(sb, (unsigned long long) discard_block, count); ret = sb_issue_discard(sb, discard_block, count); - if (ret == EOPNOTSUPP) { + if (ret == -EOPNOTSUPP) { ext4_warning(sb, "discard not supported, disabling"); clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); }