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 <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
b443e7339a
commit
5829870982
1 changed files with 1 additions and 1 deletions
|
@ -2613,7 +2613,7 @@ static inline void ext4_issue_discard(struct super_block *sb,
|
||||||
trace_ext4_discard_blocks(sb,
|
trace_ext4_discard_blocks(sb,
|
||||||
(unsigned long long) discard_block, count);
|
(unsigned long long) discard_block, count);
|
||||||
ret = sb_issue_discard(sb, discard_block, count);
|
ret = sb_issue_discard(sb, discard_block, count);
|
||||||
if (ret == EOPNOTSUPP) {
|
if (ret == -EOPNOTSUPP) {
|
||||||
ext4_warning(sb, "discard not supported, disabling");
|
ext4_warning(sb, "discard not supported, disabling");
|
||||||
clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);
|
clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue