All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: jaegeuk@kernel.org, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "Revert "f2fs: put allocate_segment after refresh_sit_entry"" has been added to the 4.11-stable tree
Date: Thu, 18 May 2017 09:45:43 +0200	[thread overview]
Message-ID: <14950935434614@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    Revert "f2fs: put allocate_segment after refresh_sit_entry"

to the 4.11-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:
     revert-f2fs-put-allocate_segment-after-refresh_sit_entry.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From c6f82fe90d7458e5fa190a6820bfc24f96b0de4e Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 4 Apr 2017 16:45:30 -0700
Subject: Revert "f2fs: put allocate_segment after refresh_sit_entry"

From: Jaegeuk Kim <jaegeuk@kernel.org>

commit c6f82fe90d7458e5fa190a6820bfc24f96b0de4e upstream.

This reverts commit 3436c4bdb30de421d46f58c9174669fbcfd40ce0.

This makes a leak to register dirty segments. I reproduced the issue by
modified postmark which injects a lot of file create/delete/update and
finally triggers huge number of SSR allocations.

[Jaegeuk Kim: Change missing incorrect comment]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/f2fs/segment.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1788,15 +1788,14 @@ void allocate_data_block(struct f2fs_sb_
 
 	stat_inc_block_count(sbi, curseg);
 
+	if (!__has_curseg_space(sbi, type))
+		sit_i->s_ops->allocate_segment(sbi, type, false);
 	/*
-	 * SIT information should be updated before segment allocation,
-	 * since SSR needs latest valid block information.
+	 * SIT information should be updated after segment allocation,
+	 * since we need to keep dirty segments precisely under SSR.
 	 */
 	refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr);
 
-	if (!__has_curseg_space(sbi, type))
-		sit_i->s_ops->allocate_segment(sbi, type, false);
-
 	mutex_unlock(&sit_i->sentry_lock);
 
 	if (page && IS_NODESEG(type))


Patches currently in stable-queue which might be from jaegeuk@kernel.org are

queue-4.11/f2fs-fix-wrong-max-cost-initialization.patch
queue-4.11/f2fs-make-flush-bios-explicitely-sync.patch
queue-4.11/revert-f2fs-put-allocate_segment-after-refresh_sit_entry.patch
queue-4.11/f2fs-check-entire-encrypted-bigname-when-finding-a-dentry.patch
queue-4.11/f2fs-fix-multiple-f2fs_add_link-having-same-name-for-inline-dentry.patch
queue-4.11/f2fs-fix-fs-corruption-due-to-zero-inode-page.patch

                 reply	other threads:[~2017-05-18  7:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14950935434614@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jaegeuk@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.