Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 663f387b authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: set CP_TRIMMED_FLAG correctly



Don't set CP_TRIMMED_FLAG for non-zoned block device or discard
unsupported device, it can avoid to trigger unneeded checkpoint for
that kind of device.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 67773a1f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ static void f2fs_put_super(struct super_block *sb)
	/* be sure to wait for any on-going discard commands */
	f2fs_wait_discard_bios(sbi);

	if (!sbi->discard_blks) {
	if (f2fs_discard_en(sbi) && !sbi->discard_blks) {
		struct cp_control cpc = {
			.reason = CP_UMOUNT | CP_TRIMMED,
		};