From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:32882 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755286AbdCJIj6 (ORCPT ); Fri, 10 Mar 2017 03:39:58 -0500 Subject: Patch "f2fs: avoid to issue redundant discard commands" has been added to the 4.10-stable tree To: jaegeuk@kernel.org, damien.lemoal@wdc.com, gregkh@linuxfoundation.org Cc: , From: Date: Fri, 10 Mar 2017 09:38:35 +0100 Message-ID: <1489135115170128@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled f2fs: avoid to issue redundant discard commands to the 4.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: f2fs-avoid-to-issue-redundant-discard-commands.patch and it can be found in the queue-4.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 8b107f5b97772c7c0c218302e9a4d15b4edf50b4 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Mon, 27 Feb 2017 11:57:11 -0800 Subject: f2fs: avoid to issue redundant discard commands From: Jaegeuk Kim commit 8b107f5b97772c7c0c218302e9a4d15b4edf50b4 upstream. If segs_per_sec is over 1 like under SMR, previously f2fs issues discard commands redundantly on the same section, since we didn't move end position for the previous discard command. E.g., start end | | prefree_bitmap = [01111100111100] And, after issue discard for this section, end start | | prefree_bitmap = [01111100111100] Select this section again by searching from (end + 1), start end | | prefree_bitmap = [01111100111100] Fixes: 36abef4e796d38 ("f2fs: introduce mode=lfs mount option") Cc: Damien Le Moal Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -935,6 +935,8 @@ next: start = start_segno + sbi->segs_per_sec; if (start < end) goto next; + else + end = start - 1; } mutex_unlock(&dirty_i->seglist_lock); Patches currently in stable-queue which might be from jaegeuk@kernel.org are queue-4.10/f2fs-add-ovp-valid_blocks-check-for-bg-gc-victim-to-fg_gc.patch queue-4.10/f2fs-avoid-to-issue-redundant-discard-commands.patch queue-4.10/f2fs-fix-zoned-block-device-support.patch queue-4.10/f2fs-fix-multiple-f2fs_add_link-calls-having-same-name.patch queue-4.10/f2fs-fix-a-problem-of-using-memory-after-free.patch