diff options
-rw-r--r-- | fs/f2fs/segment.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 3b8aed8ca7d4..8014ea9f7a55 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2253,6 +2253,12 @@ int f2fs_start_discard_thread(struct f2fs_sb_info *sbi) struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; int err = 0; + if (f2fs_sb_has_readonly(sbi)) { + f2fs_info(sbi, + "Skip to start discard thread for readonly image"); + return 0; + } + if (!f2fs_realtime_discard_enable(sbi)) return 0; |