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


Groups > linux.kernel > #1408035

Re: [PATCH] f2fs: Return the errno to the caller to avoid using a wrong page

From Yunlong Song <yunlong.song@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH] f2fs: Return the errno to the caller to avoid using a wrong page
Date 2016-05-27 14:30 +0200
Message-ID <rDp3P-3nf-13@gated-at.bofh.it> (permalink)
References <rCGzL-14D-11@gated-at.bofh.it> <rCKk2-3j5-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] f2fs: Return the errno to the caller to avoid using a wrong page Yunlong Song <yunlong.song@huawei.com> - 2016-05-25 15:00 +0200
  Re: [PATCH] f2fs: Return the errno to the caller to avoid using a  wrong page Jaegeuk Kim <jaegeuk@kernel.org> - 2016-05-25 19:00 +0200
    Re: [PATCH] f2fs: Return the errno to the caller to avoid using a  wrong page Yunlong Song <yunlong.song@huawei.com> - 2016-05-27 14:30 +0200
  [PATCH v2] f2fs: Return the errno to the caller to avoid using a wrong page Yunlong Song <yunlong.song@huawei.com> - 2016-05-26 06:40 +0200
    Re: [PATCH v2] f2fs: Return the errno to the caller to avoid using a  wrong page Yunlong Song <yunlong.song@huawei.com> - 2016-05-26 13:40 +0200
  [PATCH v3] f2fs: Return the errno to the caller to avoid using a wrong page Yunlong Song <yunlong.song@huawei.com> - 2016-05-26 13:40 +0200

csiph-web