mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: fix inconsistent using of NM_WOUT_THRESHOLD
@ 2013-04-28 11:16 Haicheng Li
  2013-04-28 11:16 ` [PATCH 2/2] f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry Haicheng Li
  0 siblings, 1 reply; 2+ messages in thread
From: Haicheng Li @ 2013-04-28 11:16 UTC (permalink / raw)
  To: linux-f2fs-devel, Jaegeuk Kim; +Cc: linux-kernel, Haicheng Li, Haicheng Li

try_to_free_nats() is usually called with parameter nr_shrink as
	"nm_i->nat_cnt - NM_WOUT_THRESHOLD"
by flush_nat_entries() during checkpointing process.

However, this is inconsistent with the actual threshold check as
	"if (nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD)"
, which will ignore the free_nats requests when
	NM_WOUT_THRESHOLD < nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD

So fix the threshold check condition.

Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
---
 fs/f2fs/node.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e275218..2a73526 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -236,7 +236,7 @@ static int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink)
 {
 	struct f2fs_nm_info *nm_i = NM_I(sbi);
 
-	if (nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD)
+	if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD)
 		return 0;
 
 	write_lock(&nm_i->nat_tree_lock);
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry.
  2013-04-28 11:16 [PATCH 1/2] f2fs: fix inconsistent using of NM_WOUT_THRESHOLD Haicheng Li
@ 2013-04-28 11:16 ` Haicheng Li
  0 siblings, 0 replies; 2+ messages in thread
From: Haicheng Li @ 2013-04-28 11:16 UTC (permalink / raw)
  To: linux-f2fs-devel, Jaegeuk Kim; +Cc: linux-kernel, Haicheng Li, Haicheng Li

Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
---
 fs/f2fs/debug.c |    1 -
 fs/f2fs/gc.c    |    1 -
 fs/f2fs/super.c |    1 -
 3 files changed, 3 deletions(-)

diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 025b9e2..08c9ce3 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -13,7 +13,6 @@
 
 #include <linux/fs.h>
 #include <linux/backing-dev.h>
-#include <linux/proc_fs.h>
 #include <linux/f2fs_fs.h>
 #include <linux/blkdev.h>
 #include <linux/debugfs.h>
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 94b8a0c..80d2747 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -11,7 +11,6 @@
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/backing-dev.h>
-#include <linux/proc_fs.h>
 #include <linux/init.h>
 #include <linux/f2fs_fs.h>
 #include <linux/kthread.h>
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index fea6e58..660e922 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/statfs.h>
-#include <linux/proc_fs.h>
 #include <linux/buffer_head.h>
 #include <linux/backing-dev.h>
 #include <linux/kthread.h>
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-28 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-28 11:16 [PATCH 1/2] f2fs: fix inconsistent using of NM_WOUT_THRESHOLD Haicheng Li
2013-04-28 11:16 ` [PATCH 2/2] f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry Haicheng Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®