diff options
| -rw-r--r-- | fs/ext4/mballoc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 8639d5a637b2..4f2d3a9d4e21 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
| @@ -2534,6 +2534,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn) | |||
| 2534 | entry->count, entry->group, entry); | 2534 | entry->count, entry->group, entry); |
| 2535 | 2535 | ||
| 2536 | if (test_opt(sb, DISCARD)) { | 2536 | if (test_opt(sb, DISCARD)) { |
| 2537 | int ret; | ||
| 2537 | ext4_fsblk_t discard_block; | 2538 | ext4_fsblk_t discard_block; |
| 2538 | 2539 | ||
| 2539 | discard_block = entry->start_blk + | 2540 | discard_block = entry->start_blk + |
| @@ -2541,7 +2542,12 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn) | |||
| 2541 | trace_ext4_discard_blocks(sb, | 2542 | trace_ext4_discard_blocks(sb, |
| 2542 | (unsigned long long)discard_block, | 2543 | (unsigned long long)discard_block, |
| 2543 | entry->count); | 2544 | entry->count); |
| 2544 | sb_issue_discard(sb, discard_block, entry->count); | 2545 | ret = sb_issue_discard(sb, discard_block, entry->count); |
| 2546 | if (ret == EOPNOTSUPP) { | ||
| 2547 | ext4_warning(sb, | ||
| 2548 | "discard not supported, disabling"); | ||
| 2549 | clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); | ||
| 2550 | } | ||
| 2545 | } | 2551 | } |
| 2546 | 2552 | ||
| 2547 | err = ext4_mb_load_buddy(sb, entry->group, &e4b); | 2553 | err = ext4_mb_load_buddy(sb, entry->group, &e4b); |
