Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1597062 > unrolled thread

[PATCH 4.9 133/153] f2fs: avoid to issue redundant discard commands

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-03-10 11:50 +0100
Last post2017-03-10 11:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.9 133/153] f2fs: avoid to issue redundant discard commands Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-10 11:50 +0100

#1597062 — [PATCH 4.9 133/153] f2fs: avoid to issue redundant discard commands

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-10 11:50 +0100
Subject[PATCH 4.9 133/153] f2fs: avoid to issue redundant discard commands
Message-ID<tjqht-2KE-31@gated-at.bofh.it>
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jaegeuk Kim <jaegeuk@kernel.org>

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 <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/f2fs/segment.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -813,6 +813,8 @@ next:
 		start = start_segno + sbi->segs_per_sec;
 		if (start < end)
 			goto next;
+		else
+			end = start - 1;
 	}
 	mutex_unlock(&dirty_i->seglist_lock);
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web