linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yunlong Song <yunlong.song@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: <cm224.lee@samsung.com>, <yuchao0@huawei.com>, <chao@kernel.org>,
	<sylinux@163.com>, <bintian.wang@huawei.com>,
	<houpengyang@huawei.com>, <heyunlei@huawei.com>,
	<liushuoran@huawei.com>, <shiguojun@huawei.com>,
	<linux-f2fs-devel@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] f2fs: Return the errno to the caller to avoid using a wrong page
Date: Fri, 27 May 2016 20:22:04 +0800	[thread overview]
Message-ID: <57483BEC.8020402@huawei.com> (raw)
In-Reply-To: <20160525165438.GB47096@jaegeuk.gateway>

On 2016/5/26 0:54, Jaegeuk Kim wrote:
> Hi Yunlong,
> 
> Do we have a bug report in terms of this?
> 

Hi Kim,
    I found the old following patch, you have mentioned one reason why "nid != nid_of_node(page)" in
that commit message.

http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=3bb5e2c8fe2296ddd9d864dcfb5ee1b77135f3ec

commit 3bb5e2c8fe2296ddd9d864dcfb5ee1b77135f3ec
Author: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Date:   Tue Apr 1 17:38:26 2014 +0900

    f2fs: return -EIO when node id is not matched

    During the cleaing of node segments, F2FS can get errored node blocks due to
    data race between node page lock and its valid bitmap operations.
    In that case, it needs to return an error to skip such the obsolete block copy.

    Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index eced8d7..065cd99 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -958,7 +958,7 @@ repeat:
                goto got_it;

        lock_page(page);
-       if (unlikely(!PageUptodate(page))) {
+       if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) {
                f2fs_put_page(page, 1);
                return ERR_PTR(-EIO);
        }
@@ -967,7 +967,6 @@ repeat:
                goto repeat;
        }
 got_it:
-       f2fs_bug_on(nid != nid_of_node(page));
        mark_page_accessed(page);
        return page;
 }



-- 
Thanks,
Yunlong Song

  reply	other threads:[~2016-05-27 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 13:01 [PATCH] f2fs: Return the errno to the caller to avoid using a wrong page Yunlong Song
2016-05-25 16:54 ` Jaegeuk Kim
2016-05-27 12:22   ` Yunlong Song [this message]
2016-05-26  4:38 ` [PATCH v2] " Yunlong Song
2016-05-26 11:30   ` Yunlong Song
2016-05-26 11:40 ` [PATCH v3] " Yunlong Song
2016-05-26  4:31 [PATCH] " Yunlong Song
2016-05-26  4:31 ` Yunlong Song

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=57483BEC.8020402@huawei.com \
    --to=yunlong.song@huawei.com \
    --cc=bintian.wang@huawei.com \
    --cc=chao@kernel.org \
    --cc=cm224.lee@samsung.com \
    --cc=heyunlei@huawei.com \
    --cc=houpengyang@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liushuoran@huawei.com \
    --cc=shiguojun@huawei.com \
    --cc=sylinux@163.com \
    --cc=yuchao0@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).