diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 2f6ee9afd3ad..418f2e663f6a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1290,6 +1290,13 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi, wait_list, issued); return 0; } + + /* + * Issue discard for conventional zones only if the device + * supports discard. + */ + if (!bdev_max_discard_sectors(bdev)) + return -EOPNOTSUPP; } #endif